can we use g_scratchpad variables from one client script to other client script , please give examples doc, link etc?

mallikharjunasw
Tera Contributor

can we use g_scratchpad variables from one client script to other client script , please give examples doc, link etc?

1 ACCEPTED SOLUTION

Hi,

Nope; you can only define scratchpad in display business rule and not in any other place either business rule of client script

once defined in display business rule you can use it in different client scripts such as onload, onchange, onsubmit

Sample Interview questions

1) What is the use of scratchpad in servicenow

2) Can it be used in other scripts such as business rule - no

3) can it be used in client scripts such as onload, onchange, onsubmit- yes

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

display business rule will only work on onLoad and onSubmit client script. it will not work on onChange() client script. 

 

display business rule store the existing server side script value and then based on client script it get executed. 

 

display business rule does not execute on database operation eg: insert, update, delete and query

it will execute once you will run the client side script ( eg: onload or onSubmit )