How to call system property in catalog client script

Devaceis
Tera Contributor

how to call a system property on a Catalog client script? 

I have defined a system property where the Value is one catalog item (AB). And for this catalog in state field On Hold option is there.

Now Requirement if in future someone add other catalog item sys_id in system property so for that item also state field option on hold should be add.

Client script-

Devaceis_0-1679644623260.png

system properties-

Devaceis_1-1679644666915.png

if someone add other item sys_id in value so for that catelog item  on hold option should come in (sc_task) state field.

Thanks.

5 REPLIES 5

@Devaceis 

use this

function onLoad() {
	//Type appropriate comment here, and begin script below
	var ga = new GlideAjax('PropertyUtilization');
	ga.addParam('sysparm_name', 'getProperty');
	ga.getXML(myCallBack);
	function myCallBack(response) {
		var prop = response.responseXML.documentElement.getAttribute('answer');
		if (g_form.getValue('sc_task.request_item.cat_item') == prop) {
			g_form.addOption('state', '5', 'On Hold', '2');
		}
	}
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader