Anyone know off hand what role a user event (runni...
# suitescript
s
Anyone know off hand what role a user event (running as current role) will run as if triggered via a suitelet? Will it use the role the suitelet is running as (if defined), or always use the user's role?
Here's what I found, in case anyone wants to know the answer. NetSuite's documentation says "Be aware that when a script triggers other scripts, the cascading scripts will run as the role of the initial triggering script's role, not the role specified on the cascaded script's role."
However, after testing this out further, this is not entirely true
If the user event is setup to run as a specific role, the user event will run as that role, regardless of the role the suitelet is running as.
If the suitelet has a role defined, and the user event is setup to run as "current role", the user event will run as the role the suitelet is running as.
If the suitelet is running as current role, and the user event is running as current role, both run as the user's role.
Maybe there are other scenarios where that statement is true, but not in the case of suitelets and user events as far as I can tell.
n
Seems logical to me, if you specify a specific role on the "parent" or "child" script that role takes precedence otherwise the logic stipulated applies. 🤷🏻‍♂️
s
I would have been surprised if the logic in NS's help was true - would be odd to have the parent script override the user event's defined role (if defined).
s
prior to the new APIs for invoking scripts programmatically, a UE invoking a Suitelet would be viewed as an independent request, following the normal rules for Suitelets. I'm not sure what the new APIs do in regards to roles/identity.
s
Which APIs are you referring to?