SG
10/21/2020, 3:08 PMPNJ
10/21/2020, 3:12 PMSandii
10/21/2020, 3:14 PM["internalid", "anyof", itemIdArray]
insteadbattk
10/21/2020, 3:21 PMSG
10/21/2020, 3:41 PMSG
10/21/2020, 3:42 PMSandii
10/21/2020, 3:47 PMbattk
10/21/2020, 3:50 PMbattk
10/21/2020, 3:50 PMbattk
10/21/2020, 3:51 PMSG
10/21/2020, 4:00 PMSG
10/21/2020, 4:01 PMSandii
10/21/2020, 4:04 PMvar lineCount = rec.getLineCount();
var itemIdArray = [];
for (var index = 0; index < lineCount; index++){
itemIdArray.push(rec.getSublistValue('item', 'item', index));
}
var itemHSNCodeObj = createAndRunSearch(itemIdArray);
//loop sublist again and read values from object above
//set values if they are in the object
function createAndRunSearch(itemIdArray){
var itemHSNCodeObj = {};
search.create({
type: 'item',
filters: ['internalid', 'anyof', itemIdArray],
columns: []
}).run().each(function (result){
//get item id, hsn, and nature
//put them in the object like
//{
// itemid: {hsn: x, nature: y},
// itemid2: {hsn: x, nature: y}
//}
})
return itemHSNCodeObj;
}
Sandii
10/21/2020, 4:06 PMSG
10/21/2020, 4:12 PMSG
10/21/2020, 4:52 PMSG
10/21/2020, 5:20 PM