alien4u
12/21/2018, 4:42 PMsome times
is not a condition, something should happen in order to create new queue recs, if you can define that then you can probably handle the logic triggering another M/R from your Summary stage and passing those new queue recs...dmashburn3
12/21/2018, 4:42 PMdmashburn3
12/21/2018, 4:43 PMalien4u
12/21/2018, 4:44 PMthe_house_painter_mr
which is going to finish the job!jen
12/21/2018, 5:11 PMjen
12/21/2018, 5:11 PMjen
12/21/2018, 5:11 PMalien4u
12/21/2018, 5:22 PMsamantha
12/21/2018, 7:36 PMsamantha
12/21/2018, 7:37 PMalien4u
12/21/2018, 7:38 PMsamantha
12/21/2018, 7:40 PMexecute(scriptContext) {}
methodandrewh
12/21/2018, 7:41 PMalien4u
12/21/2018, 7:41 PMandrewh
12/21/2018, 7:41 PMsamantha
12/21/2018, 7:45 PMreturn {
beforeLoad: beforeLoad,
beforeSubmit: beforeSubmit,
afterSubmit: afterSubmit
};
andrewh
12/21/2018, 7:47 PMsamantha
12/21/2018, 7:51 PMandrewh
12/21/2018, 7:52 PMsamantha
12/21/2018, 8:04 PMCarl Jenkins
12/21/2018, 10:03 PMYou have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.
If I get a -1 from findSublistLineWithValue I create a new payment line on VENDOR_PAYMENT
var paymentLine = payment.selectNewLine({sublistId: 'apply'});
paymentLine.setCurrentSublistValue({
sublistId: 'apply',
fieldId: 'apply',
value: true
});
paymentLine.setCurrentSublistValue({
sublistId: 'apply',
fieldId: 'amount',
value: context.amount
});
paymentLine.setCurrentSublistValue({
sublistId: 'apply',
fieldId: 'refnum',
value: context.tranid
}).commitLine({sublistId: 'apply'});
Not sure what I am missing.andrewh
12/21/2018, 10:07 PMehcanadian
12/21/2018, 10:08 PMisDynamic; true
?Carl Jenkins
12/21/2018, 10:08 PMCarl Jenkins
12/21/2018, 10:10 PMvar linenum = payment.findSublistLineWithValue({
sublistId: 'apply',
fieldId: 'internalid',
value: context.billid
});
alien4u
12/21/2018, 10:13 PMcontext
but I don't think you will have access to all of them, depending on the script type you may need to load
or use getValue
...Carl Jenkins
12/21/2018, 10:14 PMandrewh
12/21/2018, 10:15 PMCarl Jenkins
12/21/2018, 10:15 PMCarl Jenkins
12/21/2018, 10:16 PM//create a new payment for the vendor
var payment = record.create({
type: record.Type.VENDOR_PAYMENT,
isDynamic: true,
}).setValue({
fieldId: 'entity',
value: context.entity
}).setValue({
fieldId: 'trandate',
value: fmt.parse({
value: context.trandate,
type: fmt.Type.DATE
})
}).setValue({
fieldId: 'autoapply',
value: 'F'
}).setValue({
fieldId: 'memo',
value: context.memo
});
if (context.tranid) {
payment.setValue({
fieldId: 'tranid',
value: context.tranid
});
}
var linenum = payment.findSublistLineWithValue({
sublistId: 'apply',
fieldId: 'internalid',
value: context.billid
});
payment.selectLine({
sublistId: 'apply',
line: linenum
}).setCurrentSublistValue({
sublistId: 'apply',
fieldId: 'apply',
value: true
}).setCurrentSublistValue({
sublistId: 'apply',
fieldId: 'amount',
value: context.amount
}).setCurrentSublistValue({
sublistId: 'apply',
fieldId: 'refnum',
value: context.amount
}).commitLine({sublistId: 'apply'});