I'm trying to set the Rate of an item on a Purchase Order unto a custom transaction column on the Sales Order called Cost using a Workflow Action Script, but I'm finding issue accomplishing that on a multi-line Purchase Order.
salesOrderRecord.selectLine({
sublistId: 'item',
line: j
});
salesOrderRecord.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'custcol1',
value: itemRate
});
// Log
salesOrderRecordmitLine({
sublistId: 'item'
});
It functions properly when the Purchase Order has one item but completely stops when the Purchase Order has multiple items/lines. It stops right before the mitLine
method (at the Log) and doesn't continue on with the script.
If I put the .setCurrentSublistValue
and mitLine
methods into a try
block, it runs properly through the entire Purchase Order and logs that the Sales Order record has been saved (using .save()
) but when I check, the Cost hasn't been changed.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745586729a4634585.html
评论列表(0条)