Search code examples
netsuitesuitescriptsuitetalk

Transform sales order into Fulfillment


Here's the code I use to transform the sales order to fulfillment. It doesn't seems to work.

var objRecord = record.transform({
            fromType: record.Type.SALES_ORDER,
            fromId: newOrder.id,
            toType: record.Type.ITEM_FULFILLMENT
        });

Do I have to add the following line in order to work?

 var rid = objRecord.save();

Solution

  • Correct, as you have conjectured in your question, record.transform will initialise a N/record#Record object, and you need to call it's save() function to persist it in the database.