- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 09:56 AM
Hi,
I have created two variables of "Multiple Choice" data type in a CI: Type and Schedule and I have the following requirement -
If Type = "DEV" or "TEST", then, display choices as "T6", "T8", "T10".
If Type = "PROD", then, display choices as "S6", "S8", "S10".
What is the best way to fulfil this requirement?
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 10:04 AM
Hello,
Please use the below script in Onchange Catalog client script:-
Script:-
var type=g_form.getValue('type');
if(type=='dev'||type=='test')
{
g_form.removeOption('schedule','s6');
g_form.removeOption('schedule','s8');
g_form.removeOption('schedule','s10');
}
else
if(type=='prod')
{
g_form.removeOption('schedule','t6');
g_form.removeOption('schedule','t8');
g_form.removeOption('schedule','t10');
}
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 10:04 AM
Hello,
Please use the below script in Onchange Catalog client script:-
Script:-
var type=g_form.getValue('type');
if(type=='dev'||type=='test')
{
g_form.removeOption('schedule','s6');
g_form.removeOption('schedule','s8');
g_form.removeOption('schedule','s10');
}
else
if(type=='prod')
{
g_form.removeOption('schedule','t6');
g_form.removeOption('schedule','t8');
g_form.removeOption('schedule','t10');
}
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 02:05 AM
Hello,
If my answered helped you can you also mark it as correct.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 02:12 AM
Hi,
Thank you for providing the solution. I tried this but it works when I change the data type of Schedule field to "Select Box", but I need it to work on "Multiple Choice" data type.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2022 07:16 AM
Hello,
You can achieve it using the below code on Native UI
var type=g_form.getValue('type');
if(type=='dev'||type=='test')
{
g_form.getControls('schedule').forEach(function(e) {
if (e.value == 's6'||e.value == 's8'||e.value == 's10')
e.parentElement.style.display = 'none';
});
}
else if(type=='prod')
{
g_form.getControls('schedule').forEach(function(e) {
if (e.value == 't6'||e.value == 't8'||e.value == 't10')
e.parentElement.style.display = 'none';
});
}
Please mark answer correct/helpful based on Impact