Trying to complete a receipt of goods against a P.O

I'm on MAS 90 4.40.0.6 and cannot get past this... We are trying to complete a receipt of goods against a P.O.. We get the error:

 

"Update not successful: This receipt has no lines and has zero total amounts."

 

Here’s my code:

 

Set mySecur = oScript.NewObject("SY_Security", oSS, 0)

POCustomer = oSS.nLookupTask("PO_ReceiptofGoods_ui")
retVAL = oSS.nSetProgram(POCustomer)
set oCustomer = oScript.NewObject("PO_Receipt_bus",oSS)

retVal = oCustomer.nSetKeyValue("receiptNo$", "001018")
retVal = oCustomer.nSetKeyValue("ReceiptType$", "G")
retVal = oCustomer.nSetKey()
retVal = oCustomer.nSetValue("APDivisionNo$", "02")
retVal = oCustomer.nSetValue("VendorNo$", "SCR")
retVal = oCustomer.nSetValue("TaxSchedule$", TaxSched)

retVal = oCustomer.oLines.nAddLine()

retVal = oCustomer.oLines.nSetValue("ItemCode$", "/668337")
retVal = oCustomer.oLines.nSetValue("LineKey$", "000001")
retVal = oCustomer.oLines.nSetValue("OriginalQtyOrdered$", "5")
retVal = oCustomer.oLines.nSetValue("QuantityReceived$", "5")
retVal = oCustomer.oLines.nSetValue("UnitCost$", "7.76")

' Writes the line. This write value must be used before writing a new line or moving to a new tab or focus.
retVal = oCustomer.oLines.nWrite()
retVal = oCustomer.nWrite()

 

Thanks in Advance!

Parents
  • Elliot,

     

    added the line:

     

    retVal = oCustomer.nSetValue("PurchaseOrderNo$", "0010077") 'poNum exists with a single line in PO entry

     

    When i put in:

    retVal = oCustomer.oLines.CopyPurchaseOrderLines("0010077", 1)

     

    i get the error:

     

    Object doesn't support this property or Method: ' oCustomer.oLines.CopyPurchaseOrderLines'

     

    Thanks

     

    Matt

     

Reply
  • Elliot,

     

    added the line:

     

    retVal = oCustomer.nSetValue("PurchaseOrderNo$", "0010077") 'poNum exists with a single line in PO entry

     

    When i put in:

    retVal = oCustomer.oLines.CopyPurchaseOrderLines("0010077", 1)

     

    i get the error:

     

    Object doesn't support this property or Method: ' oCustomer.oLines.CopyPurchaseOrderLines'

     

    Thanks

     

    Matt

     

Children