Hello All, I have a script that worked on a Sage 100 2015 system, but is not working on Sage 100 2014 with update 5. I'm not sure if I'm just missing something obvious in my code. 1) Only the invoice header write throws the " The [invoice number] is invalid." 2) Also, getting an error on the cleanup stating " Error: 0 in Method CLEANUP ", in case that's a clue. Relevant code is below. And thank you to anyone who may have insight. retval = oInvoiceEntry.nGetNextInvoiceNo(strInvoiceNo) end if '********************************************** '*****Import invoices into SO Invoice Entry '********************************************** retVal = oInvoiceEntry.nSetKeyValue("InvoiceNo$", strInvoiceNo) retVal = oInvoiceEntry.nSetKey() retVal = oInvoiceEntry.nSetValue("InvoiceType$", "IN") retVal = oInvoiceEntry.nSetValue("InvoiceDate$", strShipDate) retVal = oInvoiceEntry.nSetValue("ARDivisionNo$", strARDivisionNo) retVal = oInvoiceEntry.nSetValue("CustomerNo$", strCustomerNo) retVal = oInvoiceEntry.nSetValue("UDF_BBB_INV_NO$", strBBInv) retVal = oInvoiceEntry.nSetValue("CustomerPONo$", strPONo) retVal = oInvoiceEntry.nSetValue("WarehouseCode$", "000") 'Add a line and assign values retVal = oLines.nAddLine() retVal = oInvoiceEntry.oLines.nSetValue("ItemCode$", strItemNo) retVal = oInvoiceEntry.oLines.nSetValue("ItemType$", "1") retVal = oInvoiceEntry.oLines.nSetValue("UnitOfMeasure$", strUOM) retVal = oInvoiceEntry.oLines.nSetValue("QuantityOrdered", Qty) retVal = oInvoiceEntry.oLines.nSetValue("UnitPrice", Price) retVal = oLines.nWrite() '******I'm checking the retval on every line of code, but this is the only one that returns an error. the value of oInvoiceEntry.sLastErrorMsg is "The [insert invoice number] is invalid." 'write the Invoice record retVal = oInvoiceEntry.nWrite() retVal = oInvoiceEntry.nClear() 'clean up oInvoiceEntry.DropObject() oLines.DropObject() set oInvoiceEntry = Nothing set oLines = Nothing oSS.nCleanup() oSS.DropObject() Set oSS = Nothing
↧