We have a transaction column field on a work order...
# suitescript
e
We have a transaction column field on a work order which sources a list/record field from each item, however we are now changing the list/record type on the item, which will mean we will lose all data in the work order columns. Can anyone suggest the most effective method of reloading the new values to replace the blank column on the work order, without having to go into each line of a work order, and reselect each item to re-source the field from the item?
For anyone interested, I achieved this with the following mass update script:
function updateWOLines(recType, recId) { var loadWO = nlapiLoadRecord(recType, recId); var itemCount = loadWO.getLineItemCount('item'); for(x = 1; x <= itemCount; x++){ var itemRecord = loadWO.getLineItemValue('item','item', x); var itemBinLocation = nlapiLookupField('item', itemRecord, 'custitem_binlocationfield'); loadWO.setLineItemValue('item', 'custcol_binlocationcol', x, itemBinLocation); } var submitRec = nlapiSubmitRecord(loadWO); }