HOW TO SET SUBLIST SUB RECORD VALUES IN SUITE SCRIPT 1.0 AND SuiteScript 2.0
Category : suitescript
Code example for setting Sublist subrecord in 1.0.
var load_inv = nlapiCreateRecord(‘inventoryadjustment’, {recordmode: ‘dynamic’});
load_inv.setFieldValue(‘account’, ‘1019’);
load_inv.setFieldValue(‘adjlocation’, 106);
load_inv.setFieldText(‘custbody_cp_transaction’, ‘Coating zero parent ‘);
load_inv.setFieldValue(‘custbody_c_from’, recid);
load_inv.selectNewLineItem(‘inventory’);
load_inv.setCurrentLineItemValue(‘inventory’, ‘item’, invadjitm);
load_inv.setCurrentLineItemValue(‘inventory’, ‘location’, 106);
load_inv.setCurrentLineItemValue(‘inventory’, ‘adjustqtyby’, 1);
var subrec = load_inv.createCurrentLineItemSubrecord(‘inventory’, ‘inventorydetail’);
subrec.selectNewLineItem(‘inventoryassignment’);
subrec.setCurrentLineItemText(‘inventoryassignment’, ‘issueinventorynumber’,invnum);
subrec.setCurrentLineItemValue(‘inventoryassignment’, ‘binnumber’,orgbin);
subrec.setCurrentLineItemValue(‘inventoryassignment’, ‘quantity’,onhand);
subrec.commitLineItem(‘inventoryassignment’);
subrec.commit();
load_inv.commitLineItem(‘inventory’);
nlapiSubmitRecord(load_inv, false, true);
Code example for setting Sublist subrecord in 2.0
define([ ‘N/record’ ],
Feel free to reach out TheSmilingCoders for proper netsuite implementation, netsuite consultation , netsuite customization, netsuite Support,netsuite Trainingcontact us at:
Email : [email protected]
Linkedin : https://www.linkedin.com/company/netsuite-academy/