Hi All,
Working on a script that is intended to read the PO line required date and if it is changed, to then go out and update the promise date on Sales Order lines. I am running into a problem getting it to store the variables. In the trace, it shows that both of these are writing out as 0. Not sure what is wrong. The first script (the one storing the variables is a post read and the second that is to trigger the update of the SO's is a Post Write. Here is the first script that doesn't write out the variables. What am I doing wrong?
'Update Sales Order Promise Date when PO Item required data is updated
'Post Read step
'Bob Osborn, ACI 9/2020
Debug_Flag = 0 : BadStart = 0 : UI = 0 : BOI = 0
StartProgram = Trim(UCase(oSession.StartProgram))
If Right(StartProgram,3) = "_UI" Then UI = 1
If (UI=0) Then BadStart = 1
If BadStart > 0 Then Exit Sub
if oSession.CompanyCode = "ABX" Then
sItemType = ""
retVal = oBusObj.GetValue("ItemType$", sItemType)
If sItemType <> "1" Then
retMsg = oSession.AsObject(oSession.UI).MessageBox("", sItemType)
Exit Sub
End If
sOriReqDate = "" : SOriItemCode = ""
retVal = oBusObj.GetValue("RequiredDate$",sOriReqDate)
retVal = oBusObj.GetValue("ItemCode$", sOriItemCode)
retVal = oScript.SetStorageVar("OriReqDate", sOriReqDate)
retVal = oScript.SetStorageVar("OriItemCode", sOriItemCode)
'retMsg = oSession.AsObject(oSession.UI).MessageBox("", sOriReqDate)
End If
Thanks in advance!
------------------------------
Bob Osborn
Consultant
ACI Consulting
------------------------------