Hiro
04/29/2020, 11:50 PM// Context Type: Create
function beforeLoad(scriptContext) {
var invoice_record = scriptContext.newRecord;
invoice_record.removeLine({
sublistId: "item",
line: 0
});
}
Result: An unexpected error has occurred. Please click here to notify support and provide your contact information.Patrick A.
04/29/2020, 11:57 PMHiro
04/29/2020, 11:58 PMbattk
04/30/2020, 12:06 AMbattk
04/30/2020, 12:07 AMPabloZ
04/30/2020, 12:15 AMHiro
04/30/2020, 12:19 AMline: 1
and it worked. Seems like it's only having problems when removing item lines from the start.PabloZ
04/30/2020, 12:19 AMPatrick A.
04/30/2020, 5:47 AMfor (var nLine = recSalesOrder.getLineCount({sublistId: 'item'}) - 1; nLine >= 0; nLine--) {
recSalesOrder.removeLine({sublistId: 'item', line: nLine, ignoreRecalc: true});
}
Patrick A.
04/30/2020, 5:48 AMHiro
04/30/2020, 7:32 PM