2

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();
mana
  • 1,075
  • 1
  • 24
  • 43

1 Answers1

4

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.

michoel
  • 3,725
  • 2
  • 16
  • 19
  • 1
    Thanks @michoel - you right! I have to add the save() line as well. It's working fine now. – mana Jun 29 '17 at 03:14