Hello, I keep getting an error saying "rec.setSubl...
# suitescript
t
Hello, I keep getting an error saying "rec.setSublistValue is not a function". Here is my code, what do you think I'm missing here
const rec = record.load({
type: record.Type.JOB,
id: recId,
isDynamic: true
});
const lineCount = rec.getLineCount({
sublistId: psCfg.JOB.SUBLIST.JOB_RESOURCE
});
const stakeholderId = 123
let ctr = rec.getLineCount({
sublistId: psCfg.JOB.SUBLIST.JOB_RESOURCE
});
// Add resource if not yet existing
rec.insertLine({
sublistId: psCfg.JOB.SUBLIST.JOB_RESOURCE,
line: lineCount
});
rec.setSublistValue({
sublistId: psCfg.JOB.SUBLIST.JOB_RESOURCE,
fieldId: psCfg.JOB.SUBLIST_RESOURCE_FIELDS.NAME,
line: lineCount,
value: stakeholderId
});
rec.setSublistValue({
sublistId: psCfg.JOB.SUBLIST.JOB_RESOURCE,
fieldId: psCfg.JOB.SUBLIST_RESOURCE_FIELDS.ROLE,
line: lineCount,
value: roleId
});
rec.save();
j
is your record loaded in standard mode or dynamic mode?
if the latter, you need to use this instead:
Record.selectLine(options) Record.setCurrentSublistValue(options) Record.commitLine(options)
t
I'm working on this using userevent script 🤔
Oh nvm, we can use this on UE too
j
is your record loaded in standard mode or dynamic mode?
look above at your code
thankyou 1
190 Views