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

Allen Andreas
Administrator
Administrator

Hi,

What I've done in these situations is to place a variable on the order guide itself, hidden by UI policy, and then create the same on the catalog item, hidden by UI policy. Have your order guide set that variable to true (if you use a true/false boolean) through use of it's own onLoad script or yes (if using a yes/no) and then have your onLoad client script for that catalog item look to see if that variable is true or yes. If so, hide variable set.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

I just wanted to check in on this.

If I've helped resolve your issue with my suggestion, please mark my reply as Correct.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Alikutty A
Tera Sage

Hello,

Why don't you write a client script within the Order guide to hide these variables? You don't need to modify your catalog item. The variables should be accessible within the client script of order guide and you could just hide them.

g_form.setVisible('variable_name', false);

Or if you need to access the order guide within a catalog item, you can use this script. If you are using London, make sure you set the Isolate script field (add it on form layout) to false so this executes

 

var orderGuide = $("sysparm_guide").value;

if(orderGuide  == 'SYS_ID_OF_Order_Guide'){

//Do your logic

}

Thanks!

 

Thanks for your reply! We are using Kingston & this could be the reason that your solution script to access the order guide within a catalog item doesn't work for me.