Catalog Variables locked in Order Guide

skirby41
Kilo Explorer

Hello,

 

I using common variable sets throughout my catalog items and order guides.   I have an order guide that is for a desktop bundle which always includes a desktop and a monitor.   I am asking upfront all the info I need with the variable set used on desktop and monitor catalog items.   I am then cascading the variables down.   The problem I am having is either hiding or setting to read only the variables on the catalog items after you select choose options.   This should just be to review what you are getting and then order.   If you need to change something you should have to go back to describe needs.   As it stands you can edit the variables on the describe needs page or the catalog items themselves.  

 

I have a couple a ideas but I don't love them.   One of them is to have 2 desktop items, one you can order by itself from the service catalog and one is only used in a bundle.   Id like not to not go that route.   The other is to have 2 variable sets 1 used on the order guide and one used on the catalog item and then on the catalog items have a UI policy that says something like if item is bundle make read only.

 

-Shane

4 REPLIES 4

randrews
Tera Guru

the easiest way is to in your standard variable set define a variable "Order guide name"   set this variable in the order guide with an on submit script...



then in the catalog items you can test for the variable name and if it is one you want them read only on you can lock them down, if the item came ala cart or from an order guide that doesn't have them fill out those variables you can leave them editable



we put this variable in our vs_employee_manager variable set which is in almost every item.


solutioningnow
Giga Guru

Hi Shane,



I also like your 2nd approach i.e., "The other is to have 2 variable sets 1 used on the order guide and one used on the catalog item and then on the catalog items have a UI policy that says something like if item is bundle make read only." With below script you can identify whether you are on Order Guide or on Individual form:



if(gel('sysparm_guide') != undefined)


alert("order guide");


else


alert("individual");



You can make use of above line of code and you can hide or make field readonly as per the requirement.



Let me know if you have any queries or suggestions.



Regards,


Solutioner


Are you locking down these fields by using UI Policy in the variable set? What you can do is create the UI Policy on the catalog item itself and set the Variable Set fields read-only from there. That way, the fields will be available to fill in on the Order Guide form, but when the user clicks through, those same fields will be locked down on the Cat Item form.


Kyryl Petruk1
Tera Expert

Hi there,




If you want to use single variable set in order guide and catalog items, you can check these values in client scripts:


g_form.getParameter('cart_edit') //empty on the "Describe Needs" step when order guide is first open, but will contain "guide_serial" string if you returned to "Describe Needs" from "Choose options" step


g_form.getParameter('sysparm_active') //contains sys_id of the catalog item on "Choose options" step, empty when item is opened individually



Example of script for variable set:


function onLoad() {


  if (g_form.getParameter('sysparm_active')!='') {


      // this stuff only runs if catalog item is viewed in Order Guide


      g_form.setReadOnly('<field_name>',true);


  }


}



Hope this helps,


Regards,


Kyryl