Without going in to the whole story we are trying to update some fields for auditing purposes and don't want the user to have the option to not save the changes to the order thus not having a record of the auditing information we are looking for. I have a script tied to SO_SalesOrderHeader Post-Read that only runs if a stored variable is a 1. When this is the case I am trying to automatically save my changes to the sales order and close the sales order but I can't seem to get this working...
I have tried this:
IF nUpdate = 1 THEN
retVal = SSScript.SetStorageVar("Update", 0)
nUpdate = 0
retVal = oScript.DebugPrint("Update " & nUpdate)
retVal = oScript.InvokeButton("BT_Accept")
retVal = oUIObj.HandleScriptUI()
END IF
I get the following error -
Error 88..... invalid/unknown property name
O/S Error.... Object required: 'oUIObj' (err/ret=2/0)
Program.... SY_MAINT.PVC
Statement.... 3031
Class.... SO_SalesOrder_Bus
Method... CalScript
I have played around with trying to use retVal = oBusObj.Write() but am not having any luck... Any advice fellow scripters?