Here's my situation:
The UDS is on the Pre-Totals event of S/O invoice header and I am trying to access a field in the "AR_PaymentType" table. I would appreciate if anyone could see by blunder in any of the 4 methods I describe here.
Methods I've tried:
- The oBusObj.GetDataSources() method indicates that "PaymentType" is a child of the invoice header, but the statement:
Set oPaymentType = oBusObj.AsObject(oBusObj.GetChildHandle("PaymentType"))
returns an error "Wrong number of arguments or invalid property assignment" - If I separate the combined statements above into two:
oPaymentType = oBusObj.GetChildHandle("PaymentType") retVal = oScript.DebugPrint(SCRIPT_ID & "oPaymentType = " & oPaymentType) Set oPaymentType = oBusObj.AsObject(oPaymentType) retVal = oScript.DebugPrint(SCRIPT_ID & "oPaymentType = " & oPaymentType)
the GetChildHandle method above returns oPaymentType = 100078 (which matches the variable "coPaymentTypeChild" value in a debug dump),
but the Set statement gets the same error as in #1 above: "Wrong number of arguments or invalid property assignment". - I tried using the existing variable "coPaymentTypeChild" directly in this statement:
oPaymentObj = 0 retVal = oBusObj.GetValue("coPaymentTypeChild", oPaymentObj) retVal = oScript.DebugPrint(SCRIPT_ID & "oPaymentObj = " & oPaymentObj) if oPaymentObj <> 0 Then Set oPaymentObj = oBusObj.AsObject(oPaymentObj)
the DebugPrint show oPaymentObj as 100078 (again, matching the variable "coPaymentTypeChild" value in a debug dump),
but the Set statement gets an error "Invalid/Unknown property name, Wrong number of arguments or invalid property assignment (err/ret=2/0)" - My final attempt is to access the "AR_PaymentType_Bus" table directly and "SetKey" to the specific PaymentType with both of the following statements (separately):
Set oPaymentObj = oBusObj.AsObject(oBusObj.GetObject("AR_PaymentType_bus")) Set oPaymentObj = oSession.AsObject(oSession.GetObject("AR_PaymentType_bus"))
Both these statements get the error message "Invalid/unknown property name, Wrong number of arguments or invalid property assignment (err/ret=2/0)"