- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2016 11:37 AM
Hello Experts,
I have a requirement to remove State Options from State field when it gets to certain state and add new options. I'm an on load client script, but I can't remove any options nor can I add any options. Please Help!
function onLoad() {
if(state == '40'){
g_form.removeOption('state', '10');
g_form.removeOption('state', '20');
g_form.removeOption('state', '30');
g_form.addOption('state', '50', 'Execution');
g_form.addOption('state', '60', 'Release');
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2016 11:50 AM
Here you go. But what about when some one changes the state?
function onLoad() {
if(g_form.getValue('state') == '40'){
g_form.removeOption('state', '10');
g_form.removeOption('state', '20');
g_form.removeOption('state', '30');
g_form.addOption('state', '50', 'Execution');
g_form.addOption('state', '60', 'Release');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2016 12:03 PM
Got you. Glad you got this fixed.