UI Policy and Order Guides

Beth Clingenpee
Giga Guru

Can a UI policy be set on an order guide to control the visibility of variables on an item included in the rule base? Or can a UI policy be set on an item with condition "if used as part of an order guide, do xyz, if not part of order guide, do abc"?

 

 

1 ACCEPTED SOLUTION

pavani_paluri
Giga Guru

Hi @Beth Clingenpee ,

 

No, an Order Guide’s UI Policy cannot control variables on the included items.

UI Policies are scoped to the record (or item) they're created on. An Order Guide can only control variables on itself, not on items it includes.
You can also use the same logic in Catalog Client Scripts:

g_service_catalog.isOrderGuide(). This method is designed for use within Service Portal and Mobile environments to identify if the current catalog item is being processed as part of an Order Guide.

if (typeof g_service_catalog !== 'undefined' && g_service_catalog.isOrderGuide()) {
// Code to execute if running within an Order Guide in Service Portal/Mobile
} else {
// Code for other contexts (e.g., native UI or standalone catalog item)
}

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

View solution in original post

6 REPLIES 6

pavani_paluri
Giga Guru

Hi @Beth Clingenpee ,

 

No, an Order Guide’s UI Policy cannot control variables on the included items.

UI Policies are scoped to the record (or item) they're created on. An Order Guide can only control variables on itself, not on items it includes.
You can also use the same logic in Catalog Client Scripts:

g_service_catalog.isOrderGuide(). This method is designed for use within Service Portal and Mobile environments to identify if the current catalog item is being processed as part of an Order Guide.

if (typeof g_service_catalog !== 'undefined' && g_service_catalog.isOrderGuide()) {
// Code to execute if running within an Order Guide in Service Portal/Mobile
} else {
// Code for other contexts (e.g., native UI or standalone catalog item)
}

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

Thank you! The catalog client script to identify if the item is part of an order guide really helped me! I was able to successfully complete the script to hide fields not needed when the order guide is used!

 

For anyone else who wants to do the same thing, here is the full script add to the catalog item:

function onLoad() {
  if (typeof g_service_catalog !== 'undefined' && g_service_catalog.isOrderGuide()) {
    // List of variable names to hide
    var varsToHide = ['employee_s_current_ad_information', 'full_name', 'title', 'department', 'email_address', 'formatter'];
   
    // Hide each variable
    varsToHide.forEach(function(varName) {
      g_form.setDisplay(varName, false);
    });
  }
}

Uncle Rob
Kilo Patron

No, HOWEVER, you can "pass" a variable from an Order Guide to a triggered Catalog Item.
Say you have "Rotisserie Chicken" yes/no variable on Order Guide and you want to invoke a UI Policy on a Catalog Item called Stock Refrigerator.

You simply add the same variable on the Stock Refrigerator Catalog Item and then use what's called an Item Variable Assignment.  As you can see by this form, you can link an Item Variable to an Order Guide Variable assuming they're the same data types.

UncleRob_0-1754071784455.png

 

Thank you! I have used the Item Variable Assignment successfully for some other needs, but it was not working in this particular case.