Script Action - why "Synchronous" option is restricted by default?

peter_repan
Tera Guru

Hi all,

I would like to redirect user after login to my custom page.

I found a workaround using Script Action on session.established event.

However gs.setRedirect("my_page.do") does not work by default (since the Script Action runs asynchronously).

To make this working I had to deactivate ACL rules for read and write on sysevent_script_action.synchronous field and check this field on Script Action form.


I would like to ask you if you know why this synchronous field on Script Action form is restricted by maint role and if I can run into any troubles when using synchronous Script Action.


Thank you

3 REPLIES 3

Brad Tilton
ServiceNow Employee
ServiceNow Employee

If you're looking to redirect a user after login, I would check out this article with the 3 most common methods.



Redirecting user logins - UI Scripts, Login Rules, or Installation Exits


Hello Brad,



I tried setting session variables to use in tables/form all accross the system (cmdb tables, all task-extended tables, catalog items) etc to be able to receive a custom sys_user field value on the client without any additional AJAX calls. For this I need the Script Action to be synchronous, else the putClientData on the session.established event does not work correctly. And as you didn't answer the question before, why is this synchronous option only available for maint role? And why shouldn't we use it? (I get that you could really do bad things, but why the restriction)


Community Alums
Not applicable

Hi,

 

Did you ever get info related to the synchronous field?

 

BR