Having an issue with a script that retrieves UDF values from the SO_ShipToAdress table when the ship to address changes on a sales order. Works in my development environment but when I move it to the customers, I get and ERROR 26 Program SY_Service.pvc line 1471. Error message is attached. The script is below. Any thoughts would be great.TIA
ARDiv = """"
ARCust = """"
tmpcustkey = """"
shiptobrokercode = """"
shiptobrokername = """"
shiptocommrate = 0.00
' First validate if there is a ship to address assigned
' if there is not than we need to populate the broker fields
' based on the customer master records since the udf fields are
' prepopulated from the ship to 'code via the udf data sources
retval = oBusObj.GetValue(""ShipToCode$"",shiptocode)
retval = oBusObj.GetValue(""ARDivisionNo$"",ArDiv)
retval = oBusObj.GetValue(""CustomerNo$"",ArCust)
retval = oScript.DebugPrint(ARdiv & ""-"" & ArCust & "" "" & shiptocode)
set oship = oSession.AsObject(oSession.GetObject(""SO_SHIPTOADDRESS_SVC""))
retval = oship.SetKeyValue(""ARDivisionNo$"",ARDiv)
retval = oship.SetKeyValue(""CustomerNo$"",ArCust)
retval = oship.SetKeyValue(""ShipToCode$"",shiptocode)
retval = oShip.FInd()
shiptobrokercode = """"
shiptobrokername = """"
shiptocommrate = 0.00
retval = oship.GetValue(""UDF_SHIPTO_BROKER_CODE$"",shiptobrokercode)
retval = oship.GetValue(""UDF_SHIPTO_BROKER_NAME$"",shiptobrokername)
retval = oship.GetValue(""UDF_SHIPTO_BRK_COMM_RATE"",shiptocommrate)
retval = oScript.DebugPrint(""Ship to Child Object Values: "" & shiptoBrokerCode & ""_"" & shiptoBrokerName & ""_"" & shiptoCommRate)
set oCust = oBusObj.AsObject(oBusObj.GetChildHandle(""CustomerNo""))
setbrokercode = """"
setbrokername = """"
setbrokercommrate = 0.00
retval = oCust.GetValue(""UDF_BROKER_CODE$"",SetBrokerCode)
retval = oCust.GetValue(""UDF_BROKER_NAME$"",SetBrokerName)
retval = oCust.GetValue(""UDF_BRK_COMM_RATE"",SetBrokercommrate)
retval = oScript.DebugPrint(""customer Child Object Values: "" & SetBrokerCode & ""_"" & SetBrokerName & ""_"" & SetBrokerCommRate)
retval = oScript.DebugPrint(""Ship To Code: "" & shiptocode)
retval = oScript.DebugPrint(""Customer: "" & ARDiv & ""-"" & ArCust)
if shiptocode = 0 or ShipToCode = """" then
retval = oScript.DebugPrint(""Values set based on customer"")
retval = oBusObj.SetValue(""UDF_BROKER_CODE$"",setbrokercode)
retval = oBusObj.SetValue(""UDF_BROKER_NAME$"",setbrokername)
retval = oBusObj.SetValue(""UDF_BRK_COMM_RATE"",setbrokercommrate)
else
retval = oScript.DebugPrint(""Values set based on ShipTo"")
retval = oBusObj.SetValue(""UDF_BROKER_CODE$"",shiptobrokercode)
retval = oBusObj.SetValue(""UDF_BROKER_NAME$"",shiptobrokername)
retval = oBusObj.SetValue(""UDF_BRK_COMM_RATE"",shiptocommrate)
End If