- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2021 07:31 PM
I have not written this before and fairly new to this approach on calling system property on client side scripting
and trying to understand how to call a system property on a Catalog client script?
I have defined a system property where the Value is null. when the system property value is null then I want to display certain options.
Below is the screenshot of the client script, when the system property is null and the value of the variable 'ref_req_company' is 'XYZ company' then an option needs to display.
It's not working and not displaying the option I have given under setDisplay.
Below is the business rule where I defined g_scratchpad
I am stuck at this point and not able to move forward. any help is greatly appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 10:29 AM
You can use below Script include.
var propertyUtil = Class.create();
propertyUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getProperty: function() {
return gs.getProperty('catalog.csa.exclude.lead_mfs');
},
type: 'propertyUtil'
});
Catalog client script.
function onLoad() {
var ga = new GlideAjax('propertyUtil'); //This argument should be the exact name of the script include.
ga.addParam('sysparm_name', 'getProperty'); //sysparm_name is the name of the function in the script include to call.
ga.getXML(myCallBack); //This is our callback function, which will process the response.
function myCallBack(response) { //the argument 'response' is automatically provided when the callback funciton is called by the system.
//Dig out the 'answer' attribute, which is what our function returns.
var prop = response.responseXML.documentElement.getAttribute('answer');
alert(prop); //alert the result to make sure all is well.
}
}
Hope it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2021 08:01 PM
No we cant use g_scratchpad variable in this case.
g_scratchpad is an empty/temporary object you can use to push information (properties, objects, functions, custom variables etc.) from the server to the client.
Note:- that information is not available currently on the form
You cannot run display business rules for catalog items.
scratchpad is a data holder which is on server and client side
Server - Display Business Rule to put data in scratch pad
Client - Read data from scratch pad and use it
For catalog item form or record producer you should make a GlideAjax call via client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 06:24 AM
Thank you for clarifying this for me.
Can you please make some suggestions on how I can achieve this. I have not used the GlideAjax call in client scripts before using the system property.
can you give me some pointers on how can I get this to working.
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 10:29 AM
You can use below Script include.
var propertyUtil = Class.create();
propertyUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getProperty: function() {
return gs.getProperty('catalog.csa.exclude.lead_mfs');
},
type: 'propertyUtil'
});
Catalog client script.
function onLoad() {
var ga = new GlideAjax('propertyUtil'); //This argument should be the exact name of the script include.
ga.addParam('sysparm_name', 'getProperty'); //sysparm_name is the name of the function in the script include to call.
ga.getXML(myCallBack); //This is our callback function, which will process the response.
function myCallBack(response) { //the argument 'response' is automatically provided when the callback funciton is called by the system.
//Dig out the 'answer' attribute, which is what our function returns.
var prop = response.responseXML.documentElement.getAttribute('answer');
alert(prop); //alert the result to make sure all is well.
}
}
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 09:09 PM
Thank you so much
I marked the answer as correct.