I am trying to update a UDF in Purchase Order entry lines during a receipt of goods. The issue I am having is that the purchase order record is locked while a receipt of goods / invoice records exist referencing the purchase order. Here is the code I am using below. I do not receive an error, but the PO line is not update. Any direction would be greatly appreciated.
editline = ""
editline = oPOLines.GETEDITKEY(lineno)
retval = oPOlines.editline(editline)
if retval = 1 then
poitem = ""
retVal = oPOLines.GetValue("ItemCode$",poitem)
retVal = oPOLines.GetValue("UDF_QTY_INTRANSIT",intranqty)
intran = intranqty - QtyReceived
retVal = oPOLines.SetValue("UDF_QTY_INTRANSIT",intran)
retVal = oPOLines.SetValue("CommentText$","Justin was here")
retVal = oPOLines.Write()
if retval = 0 then
oui.messagebox(opolines.LastErrorMsg)
end if
else
oui.messagebox(opolines.LastErrorMsg)
end if
I have also tried calling the child object, but not sure how to determine which child objects are available. Here is the code I have tried, but do not find the child object:
polineobj = 0
opolineobj = oROGLines.GetChildHandle("OrderLineKey") ' opollineobj = 0
if opolineobj <> 0 then '
Set opolineobj = oSession.AsObject(opolineobj)
else
oui.messagebox("No opolineobj object")
End if