What is the use of g_scratchpad.load_check?

akshay parekar1
Tera Contributor

Hi everyone,

I just want to know what is the use of g_scratchpad.load_check in scripting.

Is it a OOB method or might be defined somewhere?

Just want to know what is use of this

1 ACCEPTED SOLUTION

Karan Chhabra6
Mega Sage
Mega Sage

Hi @akshay parekar1 ,

 

load_check is just a property created by someone, if you are looking this in a client script, there must be a display business rule also defined on the same table where some value must be assigned to g_scratchpad.load_check.

 

In a display business rule, you can give any name to the property example:

g_scratchpad.attachments = current.hasAttachments();

or

g_scratchpad.hasAttachments = current.hasAttachments();

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

View solution in original post

6 REPLIES 6

Manmohan K
Tera Sage

Hi @akshay parekar1 

 

In ServiceNow, g_scratchpad is used to pass information from server side to the client-side.

 

Please check Display Business rule in the table where you found the code , it will be set there.

And it will be used in some client script in the same table

 

@Manmohan K , so it was used in one onChange client script, i checked it in display BR but didn't found written .

Thats why i was wondering whether its a std. method 

Karan Chhabra6
Mega Sage
Mega Sage

Hi @akshay parekar1 ,

 

load_check is just a property created by someone, if you are looking this in a client script, there must be a display business rule also defined on the same table where some value must be assigned to g_scratchpad.load_check.

 

In a display business rule, you can give any name to the property example:

g_scratchpad.attachments = current.hasAttachments();

or

g_scratchpad.hasAttachments = current.hasAttachments();

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

Arun_S1
Tera Guru
Tera Guru

@akshay parekar1 ,

 

g_scratchpad is a functionality that is available in ServiceNow to have some information stored temporarily and use that information in the client scripts.

 

For Example if you are looking at an incident form, all the incident fields can be retrieved from the client scripts using the g_form methods, but scratchpad can be used when you want to refer something that is not available on the incident table/form directly. 

 

Scratchpads are generally written on a display business rule and executed when the incident form is loaded and this can be used within the client scrips for any manipulation/validation. In your case please check for display business rules script containing the load_check, you should be able to find out the logic & what value is being stored.

 

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.