- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 01:44 PM
I've created a new hire order guide with the several variables I'd like to share across all included catalog items.
Common info I'd like to have on all catalog tasks: Supervisor/First Name/Last Name/Shift/Title/Department/EmployeeID
Catalog items: Build Computer/ Setup Phone/ Setup Email/ Create Access
There is no need for the user to see all those fields listed on each catalog item within the order guide, but I want to pass the variables to help the fulfiller.
and the following set of informaktion I'd like to carry over to each catalog item, but
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 02:11 PM
Hi Ya,
Create the common variables in a variable set and include the variable set on the order guide and all catalog items that can be selected in the order guide. In the variable set you need to create an onload client script with UI Type set to "All" so it runs on both platform and Service Portal. Should look something like this:
function onLoad() {
if (window === null) {
// check if we are in an order guide using the g_service_catalog api for Service Portal and Mobile
var isOrderGuide = g_service_catalog.isOrderGuide();
if (isOrderGuide) {
//call function to hide the fields on the catalog items if this is an order guide.
hideVariables();
}
}
else {
var item = gel("current_item");
var guide = gel("sysparm_guide");
if (item != null && guide != null && item.value != guide.value) {
hideVariables();
}
}
function hideVariables(){
g_form.setDisplay('your_var1',false);
g_form.setMandatory('your_var2',false);
g_form.setDisplay('your_var2',false);
}
}
On the order guide tick "Cascade variables" option which will copy the value of the data captured in the order guide down to the Service Catalogue items
That should now hide the variables, when displayed within an order guide. More information can be found about cascading variables at the following link - Cascade an order guide variable
Let me know how you get along.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 02:11 PM
Hi Ya,
Create the common variables in a variable set and include the variable set on the order guide and all catalog items that can be selected in the order guide. In the variable set you need to create an onload client script with UI Type set to "All" so it runs on both platform and Service Portal. Should look something like this:
function onLoad() {
if (window === null) {
// check if we are in an order guide using the g_service_catalog api for Service Portal and Mobile
var isOrderGuide = g_service_catalog.isOrderGuide();
if (isOrderGuide) {
//call function to hide the fields on the catalog items if this is an order guide.
hideVariables();
}
}
else {
var item = gel("current_item");
var guide = gel("sysparm_guide");
if (item != null && guide != null && item.value != guide.value) {
hideVariables();
}
}
function hideVariables(){
g_form.setDisplay('your_var1',false);
g_form.setMandatory('your_var2',false);
g_form.setDisplay('your_var2',false);
}
}
On the order guide tick "Cascade variables" option which will copy the value of the data captured in the order guide down to the Service Catalogue items
That should now hide the variables, when displayed within an order guide. More information can be found about cascading variables at the following link - Cascade an order guide variable
Let me know how you get along.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 10:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2019 12:25 AM
Hi Bent,
This thread helped me to achieve the same scenario. But I am facing one issue please help me out.
The catalog items which are used in the order guide can also be used individually to submit a request in that case the variables are not getting hidden. The above code is working fine if the catalog item is assiciated to an order guide but if it is submitted individually it is not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2019 12:56 AM
Hi Ya,
Please take a look at my solution provided at the following link.
Hiding Order Guide cascading variables on Desktop - DOM issues
I think this information will solve your issue.
Let me know if this worked for you.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.