Hi, I'm not sure if the entry point is the issue h...
# suitescript
t
Hi, I'm not sure if the entry point is the issue here. But I'm receiving this error message "TypeError: soRecord.setSublistValue is not a function [at ABCFunction(/SuiteScripts/Scripts/aaa_ue2.js19820)]" Did someone experience this before?
const soRecord = record.load({type: newRecord.type, id:newRecord.id, isDynamic: true});
soRecord.setSublistValue({
sublistId: 'item',
fieldId: 'custcol1',
line: 1,
value: lineItems.date || new Date()
});
soRecord.save();
b
a
specifically I think this part
also kinda weird to say "I'm not sure if the entry point is the issue" and then not say what the entry point is?
t
oh sorry. I called this setsublistvalue on AfterSubmit bowtie
I'm still getting this error 🤔
b
what does the code look like now
t
_const_ soRecord = record.load({
type: record.Type.SALES_ORDER,
id: soId,
isDynamic: true
});
soRecord.setSublistValue({
sublistId: 'item',
fieldId: 'custcol1',
line: i,
value: lineItems.date || new Date()
});
soRecord.save();
b
same answer as before, go over the documentation to go over how you are supposed to do it in dynamic mode
t
thanks @battk i just remove the isDynamic: true on the script since I'm not using it