Sunday, February 17, 2019

Create Transfer Order using scripting

This code snippet demonstrates how a Transfer Order can be created via scripting.

var tranOrder = nlapiCreateRecord('transferorder');
tranOrder.setFieldValue('location', 1); //From Location field
tranOrder.setFieldValue('transferlocation', 2); //To Location field

tranOrder.selectNewLineItem('item');
tranOrder.setCurrentLineItemValue('item', 'item', 47);
tranOrder.commitLineItem('item');

nlapiSubmitRecord(tranOrder);

Note: You can add other fields such as Transfer Price depending on your process workflow. You may refer to the SuiteScript Browser > Transfer Order to confirm the other fields you can edit on the Item sublist of a Transfer Order record.

No comments:

Post a Comment