Not able to remove choice list option from choice field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:36 PM
Hi
i have written a onLoad client script and on based of condition i am removing the choices from choice list field using removeOption() method.
g_form.removeOption(‘state’, 0);
g_form.removeOption(‘state’,2);
etc.
Except one, all choices(which i mentioned in client script) are gettinh removed from field on form.
but the first g_form.removeOption(‘state’,0); is still visible. I don’t know why it’s happening. I checked other UI policy and client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:39 PM
Hi @Jonnie_ ,
Did you checked default value on state field at dictionary level ?
Thanks,
Pratik Malviya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:42 PM
Hi @Jonnie_
There are few things which you can check to resolve this
1. Go to dictionary of that choice field and check configuration whether you've selected without None (or) With None
2. If you have selected Without None then you would have specified a default value
3. If you have specified a default value, then the field cant be removed
4. In this case what we need to do is change the configuration type to with None and try to remove the options.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:45 PM
Default value is different which is 4. I am trying to remove 0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:52 PM
Do like this and debug.
open the form and select 0 as the option.
press ctrl+alt+shift+j and pop up kind will open up
type alert(g_form.getValue("column_name"));
Run it, it will give the value in alert
copy it and try to paste that in your original scirpt.
one more thing keep "0" and "2" instead of just 0 and 2.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.