g_scratchpad not working as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 05:48 AM - edited ‎11-28-2023 05:59 AM
Hi,
I have a simple requirement to show field message if user is SLT true. I have used Display BR to get the value from user table and called that in my client script. g_scratchpad is passing undefined value to CS (checked with alert). Not sure if i am making any syntax mistake or something else. Please find below both and let me know what i am doing wrong.
Display BR
Client script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 06:14 AM
share the client script, it should work fine ideally, why don't you use parseBool
g_scratchpad.vipslt = parseBool(gr.getValue("u_vip_slt'));
and in client script use
if(g_scratchpad.vipslt == "true")
g_form.showFieldMsg();
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 06:23 AM
Hi Aman,
Now my script looks something like this but it's still not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 06:24 AM
This should be onlaod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 06:29 AM
Hi Anurag,
I tried it with onload CS but still no luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 06:34 AM - edited ‎11-28-2023 06:35 AM
just add an alert on the scratchpad on the variable in client script and see whether you are getting the value, comment everything else.
Also like 5 will not work, you cannot set value to a scratchpad in client script, only read it. the whole line is wronmg as u_vip_slt is on user table not on ritm.