Saturday, May 25, 2019

Get/Retrieve values from Subrecord Sublists

This article demonstrates how to retrieve the Inventory Detail subrecord using the viewLineItemSubrecord method. On this sample, the Serial/Lot Number, Bin and Quantity fields are retrieved from an Item Fulfillment.
var obj = nlapiLoadRecord('itemfulfillment', 8555);
var subRecord = obj.viewLineItemSubrecord('item', 'inventorydetail', 1);
var serial= subRecord.getLineItemValue('inventoryassignment', 'issueinventorynumber', 1);
var bin = subRecord.getLineItemValue('inventoryassignment', 'binnumber', 1);
var qty = subRecord.getLineItemValue('inventoryassignment', 'quantity', 1);
We used viewLineItemSubrecord method since Inventory Detail record is part of the Item sublist on the Item Fulfillment. Once it returns the nlobjSubrecord object, you may use sublist method 'getLineItemValue' to get values from the 'inventoryassignment' sublist.



DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Netsuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.

Netsuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. Netsuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.

Netsuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.

No comments:

Post a Comment