GetChildHandle from PO Entry for IM_ItemVendor_svc?

SOLVED

Hi All,

I'm grabbing the value of a UDF during PO Entry on the lines, and it's working with the below code, but I was looking for a way to access it using the ChildHanlde, but I haven't figured out how to do it.  Any ideas out there?  What would I fill in the XXXX here with?  SET oChild = oBusObj.AsObject(oBusObj.GetChildHandle ("XXXX"))

oItemVends = oSession.GetObject("IM_ItemVendor_svc")
if oItemVends <> 0 then 'oItemVends would be zero if insufficient security - will not proceed
Set oItemVends = oSession.AsObject(oItemVends)
retVal = oItemVends.SetKeyValue("APDivisionNo$", sDiv)
retVal = oItemVends.SetKeyValue("VendorNo$", sVendor)
retVal = oItemVends.SetKeyValue("ItemCode$", sItemCode)
retVal = oItemVends.Find()


retval = oItemVends.GetValue("UDF_Inspection$", sInspectionUDF)

  • +1
    verified answer

    I think you will need to keep it the way you have but to answer your question, the easiest way to figure out the XXXX for GetChildHandle is go to Custom Office > Main > UDF Maintenance then in PO Purchase Order Detail "pretend" to create a UDF (as in press Cancel when done with this exercise). Choose Business Object instead of Manual Entry. Below example shows the Data Source (your XXXX) = ItemCode if we wanted to grab UDFs created in CI_Item. I don't see one for IM_ItemVendor table though. There is another way where sometimes internal variables exist that already point to the table you need that can be referenced in script. However, since that code could change on the next upgrade or product update, it's best to stick with standard scripting mechanisms. In short, you are good. The downside of GetObject as you probably know is in Role Maintenance you have to give your P/O Entry users at least View access to Item Vendors Maintenance.

  • 0 in reply to Alnoor

    Nice.  I like that.  And thank you!