The CreatorCon Call for Content is officially open! Get started here.

How to hide catalog item variables in order guide and RITM level

Reddymahesh
Tera Contributor

I have used below catalog client script on catalog item to hide variable on order guide level, it's working as expected but it doesn't hide the same variable on RITM level(see attached for reference)

function onLoad() {
   //Type appropriate comment here, and begin script below

   var isOrderGuide = g_service_catalog.isOrderGuide();

   if(isOrderGuide){
    g_form.setMandatory('what_is_the_user_s_group',false);
    g_form.setDisplay('what_is_the_user_s_group',false);
   }
   
}

 

Reddymahesh_0-1718816231829.png

 

However, once I submit order guide, RITM that got created still shows field in the variables

 

 

 

5 REPLIES 5

SN_Learn
Kilo Patron
Kilo Patron

Hi @Reddymahesh ,

 

Please check the below post, it might help

hiding variables on order guide 

 

Please Mark My Response as Correct/Helpful based on Impact

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

This only hides variables on order guide, which I was able to do already

James Chun
Kilo Patron

Hi @Reddymahesh,

 

g_service_catalog.isOrderGuide(); only works on the Service Portal and not on the RITM page.

Try the following line of code instead:

var isOrderGuide = g_form.getValue('order_guide') || g_service_catalog.isOrderGuide();

 

Note that g_service_catalog.isOrderGuide() doesn't work when ordering the item via the backend and I am unsure about its functionality in the Mobile App.

 

Cheers

This works on RITM form as it has the order guide field , but doesn't work on catalog task form. Do we need to call  script include and check the order guide sys id and then hide fields accordingly