Thanks Alnoor. I looked at the primary key on the table, saw it has the ShipToCode in the middle and decided it would be easier to just set the browse filter for the division / customer, then walk through the results.
KPRIMARY: ARDivisionNo+CustomerNo+ShipToCode+TaxCode
retVal = oHeaderObj.GetValue(""ARDivisionNo$"",sDivisionNo)
retVal = oHeaderObj.GetValue(""CustomerNo$"",sCustomerNo)
retVal = oCustomerTaxExemptions.SetBrowseFilter(sDivisionNo & sCustomerNo & string(20-len(sCustomerNo),chr(0)))
retVal = oCustomerTaxExemptions.MoveFirst()
do until oCustomerTaxExemptions.EoF
retVal = oCustomerTaxExemptions.GetValue(""TaxCode$"",sTaxCode)
'retVal = oSession.AsObject(oSession.UI).MessageBox("""", sTaxCode)
retVal = oCustomerTaxExemptions.GetValue(""TaxExemptionNo$"",sTaxExemptionNo)
if sTaxCode = ""BCPST"" and len(sTaxExemptionNo) > 0 then
sInvoiceIsBCPSTExempt = ""Y""
end if
retVal = oCustomerTaxExemptions.MoveNext()
loop
This way I don't need to handle the ShipToCode specifically... unless the client says they need it. I was hoping there was something in the transaction, to avoid all this mess, but it seems not.
Thanks again.