Can you do updates in a database-transaction i sui...
# suitescript
e
Can you do updates in a database-transaction i suitescript? Something like:
Copy code
transaction{
   var num = record.getValue(...);
   num++;
   record.setValue(...);
   commit();
}
I want to be sure the value has not been changed between the time I read it and the time I write back
e
No, you can’t unfortunately.
e
Ok, thanks. I could not find any documentation on it, and its a bit hard searching for the word
transaction
and
netsuite
🙂
e
Yep, I get it. If you explain your use-case a bit more, someone might be able to give you another suggestion. Looks like you’re just trying to increment an auto-number field.
e
Yes, I just want to increment a quantity field. it will probably be ok, but a transaction would be preferred
look under section 4.7: SuiteApp Designs and Concurrency Issues
if you really only want numbering, then you may want to consider Numbering Custom Record Types