I want to transform sales order to item fulfillment with inventory details. I found a sample on suiteanswers. But I am unsure about how to access values like issueinventorynumber, binnumber, quantity to set on inventory details record. In the sample code they have hardcoded these values. I will appreciate your help.
var ifRec = nlapiTransformRecord('salesorder', , 'itemfulfillment');
ifRec.selectLineItem('item', 1);
ifRec.setCurrentLineItemValue('item', 'location', 1);
var ifDetail = ifRec.createCurrentLineItemSubrecord('item', 'inventorydetail');
ifDetail.selectNewLineItem('inventoryassignment');
ifDetail.setCurrentLineItemValue('inventoryassignment', 'issueinventorynumber', 25);
//lot number's Internal ID
ifDetail.setCurrentLineItemValue('inventoryassignment', 'binnumber', 1); //bin
number's Internal ID
ifDetail.setCurrentLineItemValue('inventoryassignment', 'quantity', 1);
ifDetail.commitLineItem('inventoryassignment');
ifDetail.commit();
ifRec.commitLineItem('item');
var ifID = nlapiSubmitRecord(ifRec);
That code is using SuiteScript 1, I'd strongly advise you to use SuiteScript 2. (you can recognize SS1 because of functions named with "nlapi...".
I don't have access to a Netsuite account to test it, but got this example from Netty.ai: