- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 06:12 AM
can we use g_scratchpad variables from one client script to other client script , please give examples doc, link etc?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 07:47 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 06:18 AM
Hi,
g_scratchpad variable should be defined in display business rule and then it can be used in all client scripts such as onload, onchange, onsubmit etc
display business rule:
g_scratchpad.assignment_group = current.getDisplayValue('assignment_group');
you can then use this in client script as below
function onLoad(){
alert(g_scratchpad.assignment_group);
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 04:41 PM
same g_scratchpad variable can be used in different client scripts, right?
Can we define the g_scratchpad variable in any type of scripts other than the Display Business Rule?
what are the different interview questions possible on g_scratchpad variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 07:47 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2019 01:14 AM
Does scratchpad definition works for Display business Rule for all the insert, update, delete and query operations or is there an exception?