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,

     

    That's my fault. I should have caught that myself. it works great when i accept the entire order.

     

    When not accpeting the default lines and items and using a '0' like this:

     

    retVal = oCustomer.oLines.nCopyPurchaseOrderLines("0010077", 0)

     

    i can't seem to edit the lines.

     

    Any ideas?

     

    Thanks

     

    matt

     

     

Reply
  • Elliot,

     

    That's my fault. I should have caught that myself. it works great when i accept the entire order.

     

    When not accpeting the default lines and items and using a '0' like this:

     

    retVal = oCustomer.oLines.nCopyPurchaseOrderLines("0010077", 0)

     

    i can't seem to edit the lines.

     

    Any ideas?

     

    Thanks

     

    matt

     

     

Children