How to Transform a Sales Order to Item Fulfillment with Inventory Detail via SuiteScript?

Hi,
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);
Beginner Asked on February 27, 2024 in SuiteScript.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor