HI Folks
Have a client that just upgraded from 2021 to 2024 premium. The admin there is a very capable in SQL and VB. He has an "external" application that creates Receipts of Invoice for PO.s He is reporting that it is no longer working. If anyone has any suggestions, it would be much appreciated.
errorflag = oAPOrder.nSetValue("ReceiptType$", "I")
If Convert.ToDateTime(po.invoicedate).Month = Today.Month Then
oAPOrder.nSelectbatch("MMD")
Else
oAPOrder.nSelectbatch("MMDP")
End If
errorflag = oAPOrder.nSetValue("ReceiptType$", "I")
' errorflag = oAPOrder.nSetValue("APDivisionNo$", "00")
errorflag = oAPOrder.nGetNextReceiptNo(myNewPONo)
errorflag = oAPOrder.nSetKeyValue("ReceiptNo$", myNewPONo)
errorflag = oAPOrder.nSetKeyValue("ReceiptType$", "I")
errorflag = oAPOrder.nSetKey()
erromesg = oAPOrder.sLastErrorMsg
errorflag = oAPOrder.nSetValue("PurchaseOrderno$", po.purchaseorderno)
' oAPOrder.nGetValue("ReceiptNo$", rr)
' If Not (CBool(errorflag)) Then MsgBox "SetKey Err: " & oPOEntry.sLastErrorMsg
errorflag = oAPOrder.nSetValue("APDivisionNo$", "00")
errorflag = oAPOrder.nSetValue("VendorNo$", "LEGAV01")
errorflag = oAPOrder.nSetValue("Invoiceno$", po.invoiceno)
errorflag = oAPOrder.nSetValue("invoicedate$", CDate(po.m_invoicedate).ToString("yyyyMMdd"))
' errorflag = oAPOrder.nApplyPurchaseOrderUpdate(po.purchaseorderno, "N", "N", "N")
' errorflag = oAPOrder.nSetValue("Batchno", "SPK")
' errorflag = oAPOrder.ApplyPurchaseOrderAdd(po.purchaseorderno)
' errorflag = oAPOrder.nApplyPurchaseOrderCopyLines(noofcopy)
errorflag = oAPOrder.nSetValue("ShipVia$", po.shipvia)
errorflag = oAPOrder.nSetValue("DiscountAmt", CDbl(po.discountamt))
errorflag = oAPOrder.nSetValue("FreightAmt", CDbl(po.freightamt))
errorflag = oAPOrder.oLines.nAddLine()
' errorflag = oAPOrder.oLines.sGetKey()
errorflag = oAPOrder.oLines.nSetValue("LineKey$", po.orderlinekey)
erromesg = oAPOrder.oLines.sLastErrorMsg
errorflag = oAPOrder.oLines.nSetValue("OrderLineKey$", po.orderlinekey)
commentsku = po.itemcode.Replace("""", "").Replace("_", " ").Trim()
errorflag = oAPOrder.oLines.nSetValue("ItemCode$", commentsku)
'errorflag = oAPOrder.oLines.nSetValue("OrderLineKey$", po.orderlinekey)
' errorflag = oAPOrder.oLines.nSetValue("AppliedPurchaseOrderNo$", po.purchaseorderno)
errorflag = oAPOrder.oLines.nSetValue("OriginalOrderQty", CDbl(po.originalorderqty))
errorflag = oAPOrder.oLines.nSetValue("QuantityInvoiced", CDbl(po.quantityinvoiced))
errorflag = oAPOrder.oLines.nSetValue("UnitCost", CDbl(po.unitcost))
errorflag = oAPOrder.oLines.nSetValue("ExtensionAmt", po.extensionamt)
errorflag = oAPOrder.oLines.nSetValue("CommentText$", po.commenttext)
' oPOOrder.oLines.nSetValue("CommentText$", po.commenttext)
Dim sResult As String = oAPOrder.oLines.nWrite()
------------------------------
Bob Osborn
Senior Consultant
DSD
7142645278
------------------------------