I have a JSON object that I am attempting to iterate through, which is being returned via a Netsuite script.
The JSON object contains some child elements.
I am specifically trying to access the caption for data under "classnoheirachy - name", but I am unsure how to reach the innermost child.
I would like to understand how I can use JavaScript to display the values of classnoheirachy - name and classnoheiracy-internalId.
Currently, my code loops through the JSON object as shown below. If anyone knows how I can extract the information above and add it to a new array, your assistance would be greatly appreciated.
var rs = nlapiSearchRecord('item', 'customsearch_pm_item_record_loader', itemFilters);
response.write(JSON.stringify(rs));
var retObj = [];
for ( var i = 0; rs != null && i < rs.length; i++) {
var rowObj = {};
rowObj.LOCATION = rs[i].getValue('location');
rowObj.LOCATION_AVAILABLE = rs[i].getValue('locationquantityavailable');
rowObj.CLASS = rs[i].getValue('classnohierarchy');
rowObj.CURRENCY = rs[i].getValue('currency', 'pricing');
rowObj.UNIT_PRICE = rs[i].getValue('unitprice', 'pricing');
rowObj.LOCATION_ON_HAND = rs[i].getValue('locationquantityonhand');
rowObj.ITEM = rs[i].getValue('itemid');
rowObj.ITEM_NAME = rs[i].getValue('itemid');
rowObj.PRICE_LEVEL = rs[i].getValue('pricelevel', 'pricing');
rowObj.ITEM_DESCRIPTION = rs[i].getValue('salesdescription');
retObj.push(rowObj);
}