Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update Line Items on Fulfillments
I am trying to run a scheduled script that mass updates past item fulfillments. We have a custom column for projects (custcol_col_project), and we need the main line project to populate that column for each line item.
Right now, the script is Completing, and all the logging is done, including getting the project ID. However, when I look at the item fulfillments, nothing has changed.
function updateJob_LineItem() { var records = nlapiSearchRecord('transaction', 607, null, null); //this is the internalID for the search to find related item fulfillments for ( var i = 0; records != null && i < records.length; i++ ) { try { var record = nlapiLoadRecord( records[i].getRecordType(), records[i].getId() ); var project = record.getFieldValue('entity'); var tranid = record.getFieldValue('tranid'); nlapiLogExecution('DEBUG', 'Record #' + (i+1) + ' Details', 'TranID = ' + tranid +', Project = ' + project); lines = record.getLineItemCount('item'); for ( var j = 1 ; j<= lines ; j++ ) { record.setLineItemValue('item', 'custcol_col_project', j, project); nlapiLogExecution('DEBUG', 'line updated'); } nlapiSubmitRecord(record, false, 0