Good morning. I am looking at wanting to script a UDF value that was created for the PO_VendorPriceLevel table to the Purchase Order Lines tab and this table is not available as a ChildHandle, so I am playing with the BUS object instead but am not able to make the connection so far. Here is what I have...should I be using the Header as the main object and then setting oLines instead to pull the UDF I need from the vendor price record, or is this a case where we use a "CO" object link?
sItemCode = "" : sDivNo = "" : sVendorNo = ""
retVal = 0 : oVendorPrice = 0
sOPFlag = ""
retVal = oBusObj.GetValue("ItemCode$", sItemCode)
retVal = oHeaderObj.GetValue("APDivisionNo$", sDivNo)
retVal = oHeaderObj.GetValue("VendorNo$", sVendorNo)
sMsg = "Vendor: " & sVendorNo & " ItemCode: " & sItemCode
retMsg = oSession.AsObject(oSession.UI).MessageBox("", sMsg)
set oVendorPrice = oSession.AsObject(oSession.GetObject("PO_VendorPriceLevel_bus"))
retVal = oVendorPrice.SetKeyValue("APDivisionNo$", sDivNo)
retVal = oVendorPrice.SetKeyValue("VendorNo$", sVendorNo)
retVal = oVendorPrice.SetKeyValue("ItemCode$", sItemCode)
retVal = oVendorPrice.Find()
sMsg = "Found? " & retVal
retMsg = oSession.AsObject(oSession.UI).MessageBox("", sMsg)
------------------------------
Amber Prayfrock, Blytheco
------------------------------