Posts

Showing posts from December, 2018

HOW TO SET SUBLIST SUB RECORD VALUES IN SUITE SCRIPT 1.0 AND 2.0

Subrecord values are retrieved and set in different ways in 1.0 and 2.0. Below examples can be used to understand the difference. Code example for setting Sublist subrecord in 1.0.  Note some variable have not been defined. Define them as per your accounts requirements                       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 su