Hi, I am fetching a custom record through the scri...
# suitescript
d
Hi, I am fetching a custom record through the script and I will be modifying data's, using user event after submit, I don't want other users to refer the same custom record if it's used by some script in real-time, how can I achieve it?
b
im not really sure what you are asking
is this a concurrency question?\
💯 1
d
how to lock a custom record through the script, so that other script should not refer the same custom record.
lets say I have UE which fetches one custom record and uses in the present script, since it is UE , which can run by other users when released, i don't want script to refer same custom record, because its being used by other user
Yup concurrency question
Will Enable Optimistic locking will help me? or any alternative solutions
b
opportunistic locking will make it so that netsuite will throw an error if something else has modified the custom record between when you loaded the record and saved it
d
ok
any other ways
b
you can try manually locking it using something like a checkbox
load the record, then mark a checkbox indicating that it is locked, save it
do your stuff
then unlock it afterwards
that generally relies on opportunistic locking anyway to ensure only one thing can lock the record