GMR Admin
09/30/2025, 4:23 PMInvalid API usage. You must use getSublistValue to return the value set with setSublistValue.
But I'm not using setSublistValue...
function beforeSubmit(context) {
try {
// For each expense line, if custcoll_gnt_comm_rqst has a value, copy it to cseg_comseg
for (var i = 0; i < context.newRecord.getLineCount({ sublistId: 'expense' }); i++) {
var commNo = context.newRecord.getSublistText({ sublistId: 'expense', fieldId: 'custcoll_gnt_comm_rqst', line: i });
if (commNo) {
context.newRecord.setSublistText({ sublistId: 'expense', fieldId: 'cseg_comseg', text: commNo, line: i });
}
}
} catch (e) {
log.error({
title: 'Error in beforeSubmit',
details: e
});
}
}
I think I figured out the issue just by posting this, I'll post it anyway though and see if the Map/Reduce is using setSublistValue.
The purpose of this script is to copy the value of a deprecated custom record to the custom segment that replaced it so that legacy automations can keep working while we migrate to the new segment.GMR Admin
09/30/2025, 4:40 PMnewPurchaseOrderObj.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'custcoll_gnt_comm_rqst',
value: commitmentRequestObj.values.custrecord_gnt_prchs_cmmtmnt_req_prnt_lk.value
});
GMR Admin
09/30/2025, 4:41 PMCraig
10/01/2025, 10:59 AMCraig
10/01/2025, 10:59 AMCraig
10/01/2025, 11:00 AMGMR Admin
10/01/2025, 6:51 PMCraig
10/01/2025, 6:55 PMGMR Admin
10/01/2025, 11:35 PMGMR Admin
10/01/2025, 11:35 PM