- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 10:23 AM
I am trying to populate a field(s) using Scratchpad but I am getting an undefined value passing through. Created an on Display BR and an onLoad client script. Any help would be most welcomed.
Business Rule:
Client Script:
Field:
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 10:32 AM
just change the line and check,
g_scratchpad.last_name=gr.getValue('last_name');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 10:49 AM
We all do them - and we're all glad there's someone out there to catch them.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 10:35 AM
By the way, you can consolidate that business rule (user script) down to a couple lines.
(function () {
var gr = new GlideRecord('sys_user');
if (gr.get('SYS_ID')) {
g_scratchpad.last_name = gr.getValue('last_name');
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 10:45 AM
Thanks Chuck for the responses. Your class at K16 was a great intro to the scratchpad and other concepts. Cheers!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 10:47 AM
Thanks for the kind words! Hope to see you at K17 in Orlando! More goodness coming in Istanbul and Jakarta!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2021 08:56 PM
Had similar issue. In my case it was happened due to, Display Business rule was written on the different table and we were using g_scratchpad in different table.
So after adding same Display Business rule for the table used in Client script resolved our issue.
Regards
Pawan K Singh