Questions on InvokeLookup

SOLVED

Hello,

I have create a UDF called Item code in Cash Receipt detail table and add it on the Grid. I want to create a Button script using the invokelookup which will fire off the item code list and can select the item code from the list, then set the selected value to my UDF.

I was able to make the invokelookup working, but I was failed on set the value to the UDF.

Here is my script, (which is a button script):

retVal = 0
LookupCode = "CI_ItemCommon"
ItemCode = ""
retLookup = oUIObj.InvokeLookup(LookupCode, ItemCode)

If retVal <> 0 and ItemCode <> "" then
retVal = oBusObj.SetValue("USF_MISCITEM$", ItemCode)
End If

Can anyone help me on Set the value to my UDF? (the UDF is also on the grid)

 

Thanks

Michelle

Parents
  • 0
    Hi Michelle,

    In your script above the variable for your UDF has a typo. Should be UDF not USF

    retVal = oBusObj.SetValue("USF_MISCITEM$", ItemCode) ' should be "UDF_MISCITEM$"

    If that's not the case in your real script what is the value of the returning value? (retVal) If this is zero (0) you can also check the value of oBusObj.LastErrorMsg which should give you some idea of why the setting of the variable is failing.

    Hope this helps
    Elliott
Reply
  • 0
    Hi Michelle,

    In your script above the variable for your UDF has a typo. Should be UDF not USF

    retVal = oBusObj.SetValue("USF_MISCITEM$", ItemCode) ' should be "UDF_MISCITEM$"

    If that's not the case in your real script what is the value of the returning value? (retVal) If this is zero (0) you can also check the value of oBusObj.LastErrorMsg which should give you some idea of why the setting of the variable is failing.

    Hope this helps
    Elliott
Children