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