Hide varaible set on catalog item but keeping visibility on order guide

s_nandhini
Tera Contributor

Hi,

I have created a variable set which should be visible only when the item is submitted via order guide.If the item submitted via catalog item the variable set should hide.

1 ACCEPTED SOLUTION

Sorry, I did indeed read that backwards. So, to have a variable be hidden on the Catalog Item, but visible on the Order Guide, you can do something like the following.



function onLoad() {



try {


          if($("sysparm_guide")) {


  return;


            }


        } catch(e) {


       


}


g_form.setDisplay('<name of your variable set here>',false);



}



Basically, $("sysparm_guide") will only work in an order guide and will fail on the Catalog Item, so you check if it exists (meaning you are on an order guide) and   just return, and if it fails (meaning you're not in an order guide) you hide the variable set.



Kind of ugly, but should work.



Sorry for the confusion.


View solution in original post

8 REPLIES 8

Hey Michael,



Is it on Service portal?



If not then you can use sysparm_guide.


If it is empty then hide it.



Thank you,


Ashutosh


Mike I tried your approach and it I was able to hide the variable set on catalog item, visible on order guide which is fine. However I later realized that the variable set is visible on order guide in classic UI but it is hidden on the order guide on Service Portal view. Do have any workaround for this?

REgards!

Hi Miked.jones.

I know this post is a bit old, but I tried your solution above to show an order guide-specific variable set in the order guide, but to hide it on the catalog items in the order guide under Choose Options and it worked in the platform UI and Service Portal!  I like your solution because it takes care of the whole variable set and I don't have to list each individual variable in the script.  Thank you.

This was in my Paris version Personal Instance.  I however not having the same result in our Paris version Development Instance.  I have compared everything between the PER and DEV instances in regards to the variable set settings, client script, variables Availability checkboxes (which are all checked except for Visible Elsewhere), the Order Guide settings, and all is the same.  I'm not sure where the glitch is.

Do you have any suggestions that I can try or point me to items/options that I should check?

Thank you again.

likhithkv22
Tera Contributor

do we need to keep the variable hidden by default in catalog item.