I want to have all SO Invoice lines default to an order quantity of 1 and a ship quantity of 1 (currently the default is zero). This is Sage 100 2019. I wrote the following script and attached it as a post-validation event to the Item Code column, but it returns an error 88 invalid/unknown property name every time I try it.
Here is the script:
' bws 7/24/2020
' Set Variables
OrderQty=0 : ShipQty = 0
' Set session object
Set oUI = oSession.AsObject(oSession.UI)
' Get values from current object (SO_InvoiceDetail_Bus)
retVal = oBusObj.GetValues ("QuantityOrdered", OrderQty, "QuantityShipped", ShipQty)
' Test for zero
if OrderQty = 0 and ShipQty = 0 then
retVal = oUIObj.SetValues ("QuantityOrdered", 1, "QuantityShipped", 1)
end if