- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2016 05:58 AM
I have requirement to have a list of choices to appear when certain "business services" are selected on incident records. To accomplish this we have configured a set of choice that are dependent on the business services. Currently the only way to get the choice list variables to display is by saving the record. Is there a method available to get these to change to the new values whenever the "business service" name is changed. I have looked at the gform.addOption and gform.clearOptions and other items through a client script with little luck.
Any help would be appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2016 09:35 AM
In the dependent value are you giving the sys_id of the Business application or the direct value
I just tested with the reference value and it worked fine. The values are changing dynamically

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2016 06:35 AM
If you want your choice list to update dynamically based on business service then you have to write a onChange client script on business service field.
Here is the example
function onChange(control, oldValue, newValue, isLoading) {
g_form.clearOptions('u_choice');
var cdt = g_form.getValue('u_business_appl');
if(cdt == 'AAA'){
g_form.addOption('u_choice', 1, 1);
g_form.addOption('u_choice', 2, 2);
g_form.addOption('u_choice', 3, 3);
g_form.addOption('u_choice', 4, 4);
g_form.addOption('u_choice', 5, 5);
g_form.addOption('u_choice', 6, 6);
g_form.addOption('u_choice', 7, 7);
}
else if(cdt == 'CCC'){
g_form.addOption('u_choice', 1, 1);
g_form.addOption('u_choice', 2, 2);
g_form.addOption('u_choice', 3, 3);
g_form.addOption('u_choice', 4, 4);
g_form.addOption('u_choice', 5, 5);
}
else if(cdt == 'XXX'){
g_form.addOption('u_choice', 1, 1);
g_form.addOption('u_choice', 2, 2);
g_form.addOption('u_choice', 3, 3);
g_form.addOption('u_choice', 4, 4);
}
else
g_form.clearOptions('u_choice');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2016 08:28 AM
Thanks DVP. I was hoping to avoid using that method. Would a better solution be to rewrite the above script to query the choice list table and build it automatically
?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2016 08:37 AM
DO you have a choice values per business application in a different table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2016 08:48 AM
well we were using the "Configure Choice" list to create the values to configure the drop down lists.
By using the "show choice" feature you can see the list of choices. This is all OOTB. Seems to me there should be a method to refresh the list without saving the form. Ideally this would behave as the "sub category" field works for category.