Brian Feliciano
08/12/2022, 8:51 PMname: "FIELD_1_IS_NOT_A_SUBRECORD_FIELD",
message: "Field inventorydetail is not a subrecord field.",
Brian Feliciano
08/12/2022, 8:52 PMEdgar Valdés
08/12/2022, 8:56 PMgetSubrecord
for the subsidiary record, and it was a permissions issue. For Admin run OK, for other roles it didn't.Brian Feliciano
08/12/2022, 9:03 PMbattk
08/12/2022, 9:06 PMBrian Feliciano
08/12/2022, 9:10 PMbattk
08/12/2022, 9:11 PMBrian Feliciano
08/12/2022, 9:36 PMvar inventoryDetailRecord = ifRec.getCurrentSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail'
});
var addedSerials = [];
for (var i = 0; i < validSerialList.length; i++) {
try {
inventoryDetailRecord.selectLine({
sublistId: 'inventoryassignment',
line: i
});
if (validSerialList[i] && validSerialList[i] !== 'NA') {
inventoryDetailRecord.setCurrentSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'receiptinventorynumber',
value: validSerialList[i]
});
// inventoryDetailRecord.setCurrentSublistValue({
// sublistId: 'inventoryassignment',
// fieldId: 'issueinventorynumber',
// value: validSerialList[i]
// });
addedSerials.push(validSerialList[i]);
}
inventoryDetailRecord.commitLine({
sublistId: 'inventoryassignment'
});
} catch (line_error) {
log.audit(logTitle, LogPrefix + '## ERROR ## ' + JSON.stringify(line_error));
}
}
Brian Feliciano
08/12/2022, 9:37 PMbattk
08/12/2022, 9:39 PM