gabyrdzlobaton
11/12/2021, 8:10 PMvar paymentRecord = record.transform({
fromType: record.Type.VENDOR_BILL,
fromId: vendorBillId,
toType: record.Type.VENDOR_PAYMENT,
isDynamic: false
});
var numLines = paymentRecord.getLineCount({
sublistId: 'apply'
});
var facturasMemo = '';
for(var i=0; i < numLines; i++){
var paymentVendorBill = paymentRecord.getSublistValue({
sublistId: 'apply',
fieldId: 'doc',
line: i
});
for( var j = 0; j < arrOpenBillsCount; j++){
if(scriptObj.getRemainingUsage() < 100){
log.error('poWithErrors', poWithErrors);
if(poWithErrors.length > 29){
sendErrorEmail(emailAuthor, recipientEmail, poWithErrors);
}
return
}
paymentRecord.setSublistValue({
sublistId: 'apply',
fieldId: 'apply',
line: i,
value: false
});
if(paymentVendorBill != arrOpenBills[j].getValue({ name: 'internalid'})){
continue;
}
log.debug('paymentVendorBill=' + paymentVendorBill);
paymentRecord.setSublistValue({
sublistId: 'apply',
fieldId: 'apply',
line: i,
value: true
});
facturasMemo += 'Factura #' + arrOpenBills[j].getValue({ name: 'tranid'}) + ',';
}
}
I don't know why the apply sublist field is not set to true, but the facturasMemo variable is being concatenated correctly.
Do you know if it is possible to do this?CD
11/12/2021, 8:33 PMbattk
11/12/2021, 8:34 PMbattk
11/12/2021, 8:34 PMbattk
11/12/2021, 8:34 PMgabyrdzlobaton
11/12/2021, 9:39 PMstalbert
11/12/2021, 11:50 PMstalbert
11/12/2021, 11:50 PM