So im trying to modify some some sublist fields on...
# suitescript
s
So im trying to modify some some sublist fields on a newly created Sales Order before it gets submitted to the server. Im using
beforeSubmit
as my entry point. What method do i use to create the record object to modify it before its submitted? Im having trouble determining if i should use
record.create()
or
record.load()
.
c
You don't. You use context.newRecord off the context parameter in beforeSubmit.
function beforeSubmit(context) {
context.newRecord.setValue({
fieldId: '',
value:
});
}
s
ah ok ive seen newRecord used in some examples and even used it once myself but i couldnt find the documentation behind newRecord.
c
newRecord would be the N/record module and specifically N/record.Record object
👍 1
s
Thanks 🙏
Do Standard and Dynamic Mode apply to this?
s
Not sure what you mean by apply, but it is in standard mode