Tyn Guardian
05/09/2021, 3:26 PMvar itemRecord = [];
const estimateRec = context.currentRecord;
const currLineItem = estimateRec.*getLineCount*({sublistId: estimateCfg.ESTIMATE_FLDS.ESTIMATE_ITEM});
log.*debug*('storeLineItemVal', currLineItem- 1);
for (var i = 0; i <= count - 1; i++) {
log.*debug*('storeLineItemVal_i', i);
const getLineItemId = estimateRec.*getSublistValue*({
sublistId: estimateCfg.ESTIMATE_FLDS.SUBLIST.SBLST_ITEM,
fieldId: estimateCfg.ESTIMATE_FLDS.ESTIMATE_ITEM,
line: i
});
itemRecord.*push*(getLineItemId);
log.*debug*('itemRecord', itemRecord);
}
stalbert
05/09/2021, 3:42 PMitem
sublist, it's as simple as this (NFT):
const e = new Estimate(context.currentRecord)
const itemRecord = _.map(e.item, line=> line.item)
Eric B
05/09/2021, 3:59 PMTyn Guardian
05/09/2021, 4:00 PMTyn Guardian
05/09/2021, 4:00 PMstalbert
05/09/2021, 4:27 PMstalbert
05/09/2021, 5:03 PMline => line.item
so very little room for bugs. Then again, it's also only two lines of code to do all the stuff your example was trying to do in a more convoluted way.Tyn Guardian
05/09/2021, 5:16 PMstalbert
05/09/2021, 6:34 PMbattk
05/09/2021, 8:33 PMfor (var i = 0; i < count; i++) {