JR
02/01/2021, 5:33 PMvar curRecord = currentRecord.get();
var curRecordId = curRecord.getValue ({
fieldId: 'id'
});
// 10 points
var myRecord = record.load({
type: record.Type.VENDOR_BILL,
id: curRecordId,
isDynamic: true
});
var itemListCount = myRecord.getLineCount({
sublistId: 'item'
});
var activeItemCount=0 // position of an item in initial snapshot of the
while (activeItemCount < itemListCount) {
myRecord.selectLine({
sublistId: "item",
line: activeItemCount
});
console.log("Remaining governance units: " + scriptObj.getRemainingUsage());
activeItemCount ++
}
battk
02/01/2021, 5:44 PMbattk
02/01/2021, 5:45 PMJR
02/01/2021, 6:04 PMJR
02/01/2021, 6:08 PMbattk
02/01/2021, 6:10 PMrequire(["N/currentRecord", "N/record", "N/runtime"], function (
currentRecord,
record,
runtime
) {
var curRecord = currentRecord.get();
var scriptObj = runtime.getCurrentScript();
var curRecordId = curRecord.getValue({
fieldId: "id",
});
var myRecord = record.load({
type: record.Type.VENDOR_BILL,
id: curRecordId,
isDynamic: true,
});
var itemListCount = myRecord.getLineCount({
sublistId: "item",
});
var activeItemCount = 0;
console.log("points before loop: " + scriptObj.getRemainingUsage());
while (activeItemCount < itemListCount) {
myRecord.selectLine({
sublistId: "item",
line: activeItemCount,
});
activeItemCount++;
}
console.log("points after loop: " + scriptObj.getRemainingUsage());
});
battk
02/01/2021, 6:11 PMJR
02/01/2021, 6:13 PMbattk
02/01/2021, 6:15 PMJR
02/02/2021, 8:47 PM