So we are at a loss here at the company. In Dev an...
# suitescript
s
So we are at a loss here at the company. In Dev and Release preview, we have a script created button. When the button is clicked, it runs first and then another user event script runs after. However in production, even though the order of the scripts is the same, it seems to be running out of order. Is there a way to force the order or something? I know I'm not making much sense, we're just trying to figure out why the rate is changing when a button is clicked AFTER the user event script runs
d
I believe you can do this by going to Customization > Scripting > Scripted Records. From there, select the record type that the script is applied to. You should be able to edit and reorder the script sequence. Let me know if that works. I haven't done it myself or found a need to, so I'm curious if this is the proper fix.
j
^ This does work
s
It's all the way at the bottom 😕
So what's happening is we're changing the paymentsessionamount. If the rate field on an item is changed (i'm not sure what all field changes change it) the paymentsessionamount is reset to whatever netsuite wants. The issues are we have a button from a script. Everything is working in RP and both are failing in production
g
sorry not following the question well
When the button is clicked, it runs first and then another user event script runs after.
when the button is clicked the button callback saves or reloads the record which is triggering the UEs , but the UEs run out of order?
s
Yeah, it's tough @Gerald Gillespie. The user event is the last script to run, it sets the paymentsessionamount. However, there is something else changing the paymentsessionamount No one can figure out why, but production looks exactly like sandbox and Release Preview, however it doesn't work in Production only
e
In your UE script puts some logs, after the change is done to make sure the value you wanted to set was updated. You might need to check the workflow history subtab, it might be a workflow changing the value, I would also check if the value apparently looks different in view mode but when clicking edit, actually the right value is there. Good luck! @screnshaw
g
i only do UE in 2.1 these days … the debugger for 2.1 is decent. It’ll mean throwing the deployment (or a copy of it) into testing mode. Throw a breakpoint at the key spots and see if you’re right (the debugger still isn’t great at “watch” values). if it’s something [you don’t control] changing it then you’ll have to figure out how to trump it or workaround it. If something you control is out of order then the debugger will show as you step through. if you have multiple entry point scripts then do it multiple times.
l
This environment comparison tool is designed to figure out what the difference is in exactly these scenarios. (It's not free and I work for the company). Here's a video https://www.strongpoint.io/use-cases-environment-comparison-in-netsuite