Carl 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.