How many types of script include are there??

kshitij4
Giga Contributor

please tell

7 REPLIES 7

Behshid Khairdi
Mega Expert

Hi Kshitij,

There are basically 3 types of Script Includes in  ServiceNow.

1) Client-Callable Script Include( Classless): Classless Script Includes will generally contain a single function definition, as shown below for the function getMyTitle(). However it is possible to define multiple functions within the same Script Include.find_real_file.png

 

2) Script Include with class : 

Defining a Script Include with a Class may seem more complex at first, but ServiceNow actually provides the initial code stub upon naming the record. Shown below is a basic Classdefinition.

find_real_file.png

 

3) On Demand Script Include : A Script Include that defines a single function is known as an on demand, or classless, Script Include. The function is callable from other server-side scripts. On demand Script Includes can never be used client-side even if the Client callable option is selected.

It is critical that the Script Include name is an exact match for the name of the function. In the example, both the Script Include and the function are named sumTwoNums.

find_real_file.png

 

 

Rohit Kaintura
Mega Guru

Hi,

 

Mainly two types of script include are available i.e. client callable( that is called from client script) & server side(that calls from server side).

 

Rajesh Mushke
Mega Sage
Mega Sage

Hey kshitij,

i hope your query is been answered, can you please close this thread, then only this will be helpful for other community users

Let me know if you need more help..!!

 

Thanks,

Rajashekhar Mushke,

Community Leader - 18



Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke