did anyone every had any issue using this record.s...
# suitescript
k
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
What issues are you having with it?
k
I didn't get any issue but wanted to check if this 100% accurate to use in PROD
j
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
Just looking at Record has been changed and Unexpected Error
will these conflict with Submit fields
s
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
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
I don’t think you’d get
Unexpected Error
, you’d just get the
Record has been changed
s
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
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
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
Got it, will this happens while submitting or after submitting because may be I can put try catch to retry multiple times
s
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
No I'm using for restlet
s
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
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
Thank you that totally make sense
Thank you so much for everyone input and appreciate you all