removing options in a dropdown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 10:54 AM
Hey all,
I cant work out why my scripts are not working. i need to do this this on two different tables/locations
1. Catalog item. I need to remove an option dependent on the answer to the previous question. my script is below, I have changed this several times but cant work out what is wong with my script. I guess the first question is can this be done on a catalog item?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var ecms_mob = g_form.getValue('ecms_mobile');
if (ecms_mob =='No'){
g_form.removeOption('device_type', 'Smartphone');
}
}
2. Removing resolved as an option based on an incident being a new ticket.
function onLoad() {
if (g_form.isNewRecord())
g_form.removeOption("state", 6);
}
I have been going around in circles on these, if someone could point out the problem it would be most appreciated.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 12:00 PM
Just to confirm, the value and fields have been copied and pasted from the variables. Even the "No" just to be certain!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 12:03 PM
Yeah, we use it in our own Catalog Client Scripts with success, so it should work for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 12:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 12:35 PM
Thank you so much for the help on this.
it works when i do Try it within the cat item but its not working on the portal using the same cat item.....
Any thoughts?
Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 12:39 PM
Make the UI Type = ALL (or Both, depending on your version) then try it.