In a user event script, is it possible to set tran...
# suitescript
t
In a user event script, is it possible to set transaction sublist values where other values automatically calculate, like they do in the UI? I need other values like amount and tax details to automatically calculate. I am doing this logic when a record is transformed. Doing this through a client script works but I need this to work when transformed in bulk through a suitelet, where I think client scripts wont run on the newly transformed records. It's my understanding user event scripts are always in standard mode. How should I handle this?
r
you need the record object to be in dynamic mode. Once you are in dynamic mode, the order of setting the values is critical
t
I am aware of dynamic mode simple smile but how would I have it in dynamic mode if I'm doing this from a user event script? This is supposed to work when they transform the record normally via the button in netsuite. It's also supposed to work when I bulk transform these records through a suitelet
r
Are you creating the record object? If yes, there should be a parameter called
isDynamic
. If the script is running in the After Submit event, you can load the record and use the same parameter. Not sure how you will do it in Before Submit.
t
For the suitelet I will be creating the records yes, through record.transform which im aware can use dynamic mode. But the functionality that already exists is just a button press in netsuite, I don't have control over this. Doing this in after submit purely for dynamic mode really doesn't sound like a good idea. It's very unclear to the user what's actually happening since I'll be adding and removing items after they already save