- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2018 05:54 PM
Hi Guys,
I have a display business rule that I am calling from a client script. When calling using g_scratchpad I am getting a "undefined" error when trying to retrieve the value of the field.
I know i am missing something really small please see below:
Display Business Rule:
Onload Client Script:
Error:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2018 11:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2018 06:02 PM
The tables have to be the same for the display BR and the record. Is the table for the BR on incident?
Also if that doesn't work, I would swap out:
user.get from BR and just do
user.addQuery('user_name', gs.getUserID());
user.query();
Or try
var user = gs.getUserID();
g_sctrachpad.source = user.getValue('source)';
ORRRRR
In your first screenshot the ; is a space away too far after the source getValue, could move it back one.
And in your client script you're missing your brackets after if {
then closing before } else then again reopening {
and a final close }
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2018 06:18 PM
Hi Allen,
Yes both are on the Incident Table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2018 06:28 PM
Great, see my other comments in that same post. 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2018 06:34 PM
Just wanna update this thread so that other users should not get confused.
Q: Or try
var user = gs.getUserID();
g_sctrachpad.source = user.getValue('source)';
A: gs.getUserID(); will output a string, not the Glide Object. So it wont work.
Q: In your first screenshot the ; is a space away too far after the source getValue, could move it back one.
A: it doesnt matter for the compiler.
Q:And in your client script you're missing your brackets after if {
then closing before } else then again reopening {
and a final close }
A: It doent matter for the compiler, if you have multiple lines under your loop (if/else/for/while etc etc) then you must wrap them in braces. Or else wrapping them in braces is optional.