- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:02 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:17 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:28 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:17 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:32 AM - edited 06-06-2023 12:35 AM
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.