g_scratchpad not working as expected

Sarabjeet1
Tera Contributor

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 

Sarabjeet1_0-1701179920602.png

 

 

Client script

Sarabjeet1_1-1701179167814.png

 

 

 

 

14 REPLIES 14

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();

 

Best Regards
Aman Kumar

Hi Aman,

Now my script looks something like this but it's still not working.

 

Sarabjeet1_1-1701181386783.png

 

 

This should be onlaod

-Anurag

Hi Anurag,

 

I tried it with onload CS but still no luck.

Sarabjeet1_0-1701181734575.png

 

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.

-Anurag