- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2019 11:37 AM
Is there a reason why I have a blank option for one of my variable on this catalog item?
Is there something in my script that can cause this?
\
I also have Read Only as a choice under this variable.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 08:28 AM
Try this:
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue === '') { return; } var test = g_form.getValue('access_needed'); //Change accordingly g_form.clearOptions('type_of_access'); if(test == 'flowcal mlp'){ //Change accordingly g_form.removeOption('type_of_access', 'read only'); g_form.addOption('type_of_access', 'edit','Edit'); } else { g_form.addOption('type_of_access', 'edit','Edit'); g_form.addOption('type_of_access', 'read only', 'Read Only' ); } }
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2019 12:02 PM
Not sure if that is fully the cause, but in your screenshot, you have a different case for "read only" in the remove option for read only vs. what the addOption says (which is Read Only). So maybe that's causing something?
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2019 12:04 PM
You also have this thread going on as well...
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2019 12:20 PM
Try this and see if it helps
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var test = g_form.getValue('access_needed'); //Change accordingly
g_form.clearOptions('access_needed');
if(test == 'flowcal mlp'){ //Change accordingly
g_form.addOption('type_of_access', 'edit');
g_form.removeOption('type_of_access', 'read Only');
}
else
{
g_form.addOption('type_of_access', 'edit');
g_form.addOption('type_of_access', 'read only');
}
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2019 01:14 PM
this script hides the choices for please select the access