how to identify from which order guide a catalog item is triggered?

Pooja85
Giga Contributor

Hello All,

I got a requirement to hide a variable set on a catalog item onLoad when it is triggered from a particular order guide.Though I am able to find that the the catalog item is triggered from an order guide using "g_service_catalog.isOrderGuide()" but how will I check if is triggered from a particular order guide ?Is there any way to do this? Could any anyone please guide me on this.

Thanks!

14 REPLIES 14

@Poojan, You can try this script, it will get you the required SYS ID of Order guide

function onLoad() {
	
	var orderGuide = $("sysparm_guide").value;
	alert(orderGuide);
	if(orderGuide  == 'SYS_ID_OF_Order_Guide'){
		//Do your logic
		g_form.setDisplay('variable_name', true);
		
	}
	
}

@Alikutty Thanks!! I am able to get the sys_id of the order guide but only from the back-office .From the portal it gives me error in the browser console saying "TypeError: $ is not a function". Will it not work from the portal? Is there a method which works from both back-office & portal.

 

The above code uses Jquery and it does not work in service portal. For portal, the only known working function is g_service_catalog.isOrderGuide(). This will tell you whether catalog item is part of an order guide or not but it wont give you its sys_id.

If you are really looking to get the SYS_ID of order guide in portal then i guess you will need to hard code it somewhere in a variable or script and use it.

Efrem
Kilo Contributor

I've tried this logic, but I always get null for $("sysparm_guide").
Any ideas why?

Surya3
Kilo Contributor
Hi My issues is to hide one variable in ordige guide form but that particular varible needs to visible in ritm level , please suggest what can be done