https://netsuiteprofessionals.com logo
#suitescript
Title
# suitescript
k

Kevin

04/28/2022, 8:53 PM
did anyone every had any issue using this record.submitFields(Options) and how accurate this could be in order to use in mass updating in PROD ?
s

scottvonduhn

04/28/2022, 8:53 PM
What issues are you having with it?
k

Kevin

04/28/2022, 8:54 PM
I didn't get any issue but wanted to check if this 100% accurate to use in PROD
j

jen

04/28/2022, 8:55 PM
what makes you suspect it wouldn’t work, other than just general distrust in NetSuite?
true news 1
netsuite 2
might be better to just use the built-in mass update tool…?
k

Kevin

04/28/2022, 9:00 PM
Just looking at Record has been changed and Unexpected Error
will these conflict with Submit fields
s

scottvonduhn

04/28/2022, 9:02 PM
Using record.submitFields IS making a change to a record, however it does work differently from a regular record edit. Then again, Mass Updates can also work differently than a regular edit (they all have a different context type for User Events).
What is the specific concern with Record has been changed and Unexpected Error ?
k

Kevin

04/28/2022, 9:06 PM
Lets say, someone load and making changing, meantime, someone made another change and submitted record, these kind of things encountering
Record has been changed error
. if multiple instances loading same record at same time then this is throwing
Unexpected error
thats where I'm so concerned about it
j

jen

04/28/2022, 9:08 PM
I don’t think you’d get
Unexpected Error
, you’d just get the
Record has been changed
s

scottvonduhn

04/28/2022, 9:08 PM
Yes, those errors can happen. Ultimately, there is nothing you can do to prevent any and all such errors. They can happen even just for 2 users trying to edit the same record through the UI, and it can also happen for two scripts trying to change the same record at the same time. In that sense, the scripts are neither immune from, nor subject to, more or less errors than a logged in user.
k

Kevin

04/28/2022, 9:10 PM
I'm wondering what logic I can throw to prevent or reduce or retry logic
Have you all ever seen those errors while submitting fields
s

scottvonduhn

04/28/2022, 9:12 PM
I have seen Unexpected Errors in the most random places … and sometimes it has never been reproducible. It’s not generally something I worry about
k

Kevin

04/28/2022, 9:13 PM
Got it, will this happens while submitting or after submitting because may be I can put try catch to retry multiple times
s

scottvonduhn

04/28/2022, 9:14 PM
One thing to note, if you are using a Map/Reduce script, you may not always want to catch errors, as it has a builtin mechanism for dealing with them
k

Kevin

04/28/2022, 9:14 PM
No I'm using for restlet
s

scottvonduhn

04/28/2022, 9:15 PM
In any other script, an uncaught error will stop the script completely, but sometimes that is a good thing. You might be able to retry, but could encounter the error again
b

battk

04/28/2022, 9:18 PM
record.submitFields is an xedit
it wont trigger record has been changed, only the normal record load and save will do that
so dont rely on it to protect you from concurrency
its also an xedit, so it behaves differently during user event scripts
beware badly written user events that were not tested against xedits
k

Kevin

04/28/2022, 9:25 PM
Thank you that totally make sense
Thank you so much for everyone input and appreciate you all
4 Views