Questions on client scripts

Shaik22
Tera Expert

Hello,

 

Please provide answers of below questions.

 

1.What are the limitations of client scripts.

2.Where the places client script will be useful.

3.Fix script vs Background script.Could you please give me example of each.

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@Shaik22 A client script is a script which runs at the client side on the browser. 

1. Limitations: Server side objects like gs, current, previous are not directly available at the client side. In order to perform a server side operation, usage of GlideAjax is needed.

2. Usability: Client script are usable in cases when the client side validations e.g. to make a field mandatory, read only are needed. Client side helps in reducing the load of computation on the server side as a lot of it can be managed at the browser level.

3. Background script allows a user to execute a server side script from a console in Global or custom scoped application. These type of script are not usually stored in SerivceNow.

4. Fix script is a server side script which can be stored and used repetitively in Global or scoped applications.

 

Hope this helps.

View solution in original post

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@Shaik22 A client script is a script which runs at the client side on the browser. 

1. Limitations: Server side objects like gs, current, previous are not directly available at the client side. In order to perform a server side operation, usage of GlideAjax is needed.

2. Usability: Client script are usable in cases when the client side validations e.g. to make a field mandatory, read only are needed. Client side helps in reducing the load of computation on the server side as a lot of it can be managed at the browser level.

3. Background script allows a user to execute a server side script from a console in Global or custom scoped application. These type of script are not usually stored in SerivceNow.

4. Fix script is a server side script which can be stored and used repetitively in Global or scoped applications.

 

Hope this helps.

manjusha_
Kilo Sage

@Shaik22 

 

ServiceNow Client scripts are Javascript that runs on the client-side (the user's web browser) and instead of the server (on the server).  Often it is used for immediate form changes, form validation, or user input, and when limited database lookups are needed

Limitations-

1.sequencing is not available in client scripts running on same table

2. Lenghty code can affect the performance

3.No access to certain ServiceNow libraries such as GlideSystem

 

More about fix script and background script use below link

https://www.servicenow.com/community/now-platform-forum/what-is-the-difference-between-fixed-scripts....

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact

Thanks,

Manjusha Bangale