What is Global in client script ?

caseid
Kilo Explorer

What is Global in client script ?

4 REPLIES 4

HarshTimes
Tera Guru

HI Prathap


We can define many views for a table. Checking global means the client script will run for all the views . If you uncheck that and put the view name then the client script will run only for that view.



Regards


Harsh


Community Alums
Not applicable

Hi Prathap,



I believe you are referring to "Global" field on client script form.


It is the Indicator of whether the script applies to all views. When Global is selected, the script runs regardless of what view is being displayed. When Global is not selected, this script runs only if the current view matches the script's view.



Let me know if you have any queries.


dianemiro
Kilo Sage

Hi Prathap,



Global application in client script means the script can be used globally meaning to all your applications. While the other options is the name of your other application, if one of the application is selected, it limits the client script to be use on the current application you've chosen.



Please click Like, Heplful Yes or Correct Answer if applicable only.


Best Regards,


Diane Miro


Diane, this is incorrect. To stop confusion for anyone who sees the above answer in the future.

The correct answer is: If Global is set to true, the client script runs on all views of the selected table the Client Script is associated with. If Global is set to false then the View field will be made available so that you can specify the table view that the Client Script should run on. 

 

It is clearly explained in the documentation: https://docs.servicenow.com/bundle/rome-application-development/page/script/client-scripts/concept/c...

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul