Quantcast
Channel: Sage 100
Viewing all articles
Browse latest Browse all 36990

Forum Post: AR Invoice Data Entry Script Error - You cannot change invoice type

$
0
0
Hi All, I'm hoping one of the more experienced BOI script writers can help me out with this error.  I've pasted the code below (minus error checking).  The data I'm importing will always have only one record for each invoice, so there will only be one line item per invoice.  There are some records that have an invoice type of IN and others that have an invoice type of CA.   The script throws the error "You cannot change invoice type" when it runs into a record that is not the same invoice type as the ones prior.  It does write the record anyway and creates invoices of only one type (IN or CA for all invoices) depending on whether the first record in the file was a CA or IN type.  Hoping someone can catch my mistake..  Thank you! 'assign invoice header record values retVal = oARInvoiceEntry.nSetKeyValue("InvoiceNo$", strInvoiceNo,7) retVal = oARInvoiceEntry.nSetKeyValue("InvoiceType$",strInvoiceType) retVal = oARInvoiceEntry.nSetKey() retVal = oARInvoiceEntry.nSetValue("ARDivisionNo$", strARDivisionNo) retVal = oARInvoiceEntry.nSetValue("CustomerNo$", strCustomerNo) retVal = oARInvoiceEntry.nSetValue("InvoiceDate$", strInvoiceDate) retVal = oARInvoiceEntry.nSetValue("InvoiceDueDate$", strInvoiceDueDate) retVal = oARInvoiceEntry.nSetValue("TermsCode$", strTermsCode) 'Add a line and assign values retVal = oARInvoiceEntry.oLines.nAddLine() retVal = oARInvoiceEntry.oLines.nSetValue("ItemCode$", strItemCode) retVal = oARInvoiceEntry.oLines.nSetValue("SalesAcctKey$", strSalesAcct, "kACCOUNT") retVal = oARInvoiceEntry.oLines.nSetValue("Quantity", Quantity) retVal = oARInvoiceEntry.oLines.nSetValue("ExtensionAmt", ExtensionAmt) retVal = oARInvoiceEntry.oLines.nWrite() 'write the invoice record retVal = oARInvoiceEntry.nWrite()

Viewing all articles
Browse latest Browse all 36990

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>