The CreatorCon Call for Content is officially open! Get started here.

Difference between client script and script include (server).

Mi4
Tera Expert

Hello,

Sorry for the elementary question.

I'm studying servicenow, and also learning about development and mechanics.

My question:

Why does servicenow write the processing separately with client script and script include (server)?  

For example, in SAP, everything is written on the server side, including screen control and check processing.

What is the meaning and advantage of writing the processing separately?

We believe that understanding this mechanism will help you code efficiently in the right places.

 

Regards,

1 ACCEPTED SOLUTION

Hi Mi
 
SAP GUI Scripting is required in order to Enable UI elements recognition in SAP GUI. User needs to update scripting setting by configuring his client, then the server system that user is connecting to.you need to enable the scripting before use.
 
Enabling SAP Scripting:-
 
In Service Now,You Have to write the separate scripts for client and Server Side.
 
Client Script:-Every user's Browser has the JavaScript Engine Installed by Default.basically all Rendered Items are configured before they gonna stored in Database using simple Java Script Code embedded in UI Policy or Client Scripts like Facilities.
UI Policy:-
 
Client Scripts:-
 
Server Side Script:-Here we have to deal with the actual data which is stored in Database or needed to be stored in Database.It is also JavaScript code embedded in Business Rule,Script Include.
Business Rule:-
 
Script Include:-

 

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat

View solution in original post

11 REPLIES 11

Runjay Patel
Giga Sage

Check out this video, it will clear all your doubts and help you to understand Client Script queries in details.

Link: https://www.youtube.com/watch?v=Wj8ZAWtTBqo&ab_channel=ServiceNowHelpdesk

It help you to understand below points.

  • UI policy and Client script
  • why client script run first in service now?.
  • Which rule execute first client Scripts or UI polices?
  • g_user and g_form tips
  • Difference between client script and script include (server).
  • Scenario based implementation
  • Understanding below
    • onLoad()
    • onChange()
    • onSubmit()
    • onCellEdit()

 

Please mark reply as Helpful/Correct, if applicable. Thanks!!

SumitS
Tera Contributor

 

  • Client Scripts: Execute on the client side (browser). Best for immediate user feedback and manipulating form fields.
  • Script Includes: Execute on the server side. Best for complex, reusable logic and server-side operations like sending emails or processing data.