The CreatorCon Call for Content is officially open! Get started here.

Scratchpad undefined value

terp
Giga Contributor

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:

find_real_file.png

Client Script:

find_real_file.png

Field:

find_real_file.png

1 ACCEPTED SOLUTION

BALAJI40
Mega Sage

just change the line and check,


g_scratchpad.last_name=gr.getValue('last_name');


View solution in original post

9 REPLIES 9

We all do them - and we're all glad there's someone out there to catch them.


Chuck Tomasi
Tera Patron

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


        }


})();


Thanks Chuck for the responses.   Your class at K16 was a great intro to the scratchpad and other concepts.   Cheers!


Thanks for the kind words! Hope to see you at K17 in Orlando! More goodness coming in Istanbul and Jakarta!


pawan k singh
Tera Guru

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