What does g_scratchpad._ajaxChecked do?

hanaphouse
Giga Guru

Can someone explain what g_scratchpad._ajaxChecked do? I can't find any reference right now but I see lots of scripts using it.

1 ACCEPTED SOLUTION

Hi,

 

As suggested above its just a variable that is used for g_scratchpad object. g_scratchpad passes value from Server to Client when client (form) requires information that is not avaiable on the form (fields of the form).

So, look for Business rule & search with filter Script | Contains | g_scratchpad._ajaxChecked

You will find an entry where a value will be used in combination as below

g_scratchpad._ajaxChecked = ....something

 

This then is used in Client script in format

g_scratchpad._ajaxChecked so as to get value from Server (Business rule) to Client.

For better understanding try the same search as suggested above for Business Rule & then Client script.

View solution in original post

8 REPLIES 8

Harsh Vardhan
Giga Patron

seems like "g_scratchpad" has defined inside display business rule.

 

you can refer below blog as an example. 

 

https://community.servicenow.com/community?id=community_blog&sys_id=dc49feeadbdd7f0c54250b55ca96191d

 

Note: it's just a way to call asyn ajax on onsubmit client script  . you can declare a variable using g_scratchpad.  

 

https://hi.service-now.com/kb_view.do?sysparm_article=KB0783579

 

 

Thanks but how about the ._ajaxChecked? What does it mean when it is true or false?

its just a variable.

g_scratchpad is an object which has a variable _ajaxChecked

 

you can have any name eg:

 

g_scratchpad.test >> so test is variable here. 

Ankush Jangle1
Kilo Guru

Hello,

g_scratchpad is a temporary variable to pass server side values to client side if client need server data. Display business rule is used to initialize scratchpad and make it available to client script.


Ex: if you want caller information then we use it in below manner.

 

Business rule:

 

(function executeRule(current, previous /*null when async*/) {
g_scratchpad.email= current.caller.email;
g_scratchpad.phone= current.caller.phone;
})(current, previous);

 

Please Mark it helpful/Correct if it helps you

Regards

Ankush