I hope this is something easy that I'm overlooking. I'm looking up an invoice in the AP_OpenInvoice table that I know exists. I have confirmed that I'm passing the correct vendor division, number, and invoice number. But I'm getting a 0 return value. I'm also checking for errors after each SetKeyValue, but no errors are returned.
Am I completely off here?
retVal = oAPOpenInvoice.nSetKeyValue("APDivisionNo$",strAPDivisionNo)
ErrorLog retVal, "Error Setting Division No while looking up invoice.", oAPOpenInvoice.sLastErrorMsg, strInvoiceDate, strAPInvoiceNo, strVendorNo, strFileName
retVal = oAPOpenInvoice.nSetKeyValue("VendorNo$",strVendorNo)
ErrorLog retVal, "Error Setting Vendor No while looking up invoice.", oAPOpenInvoice.sLastErrorMsg, strInvoiceDate, strAPInvoiceNo, strVendorNo, strFileName
retVal = oAPOpenInvoice.nSetKeyValue("InvoiceNo$",strInvoiceNo)
ErrorLog retVal, "Error Setting Invoice No to " & strInvoiceNo & " while looking up invoice.", oAPOpenInvoice.sLastErrorMsg, strInvoiceDate, strAPInvoiceNo, strVendorNo, strFileName
retInvLookup = oAPOpenInvoice.nFind()
wscript.echo "retInvLookup: " & retInvLookup 'returns 0, though I've confirmed the invoice exists for this vendor
retVal = oAPOpenInvoice.nSetKeyValue("APDivisionNo$",strAPDivisionNo) ErrorLog retVal, "Error Setting Division No while looking up invoice.", oAPOpenInvoice.sLastErrorMsg, strInvoiceDate, strAPInvoiceNo, strVendorNo, strFileName retVal = oAPOpenInvoice.nSetKeyValue("VendorNo$",strVendorNo) ErrorLog retVal, "Error Setting Vendor No while looking up invoice.", oAPOpenInvoice.sLastErrorMsg, strInvoiceDate, strAPInvoiceNo, strVendorNo, strFileName retVal = oAPOpenInvoice.nSetKeyValue("InvoiceNo$",strInvoiceNo) ErrorLog retVal, "Error Setting Invoice No to " & strInvoiceNo & " while looking up invoice.", oAPOpenInvoice.sLastErrorMsg, strInvoiceDate, strAPInvoiceNo, strVendorNo, strFileName retInvLookup = oAPOpenInvoice.nFind() wscript.echo "retInvLookup: " & retInvLookup 'returns 0, though I've confirmed the invoice exists for this vendor
Thanks!