How to show choice values dynamically based on another field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 07:21 AM
Hi,
I have a requirement to show choice values dynamically based on other field.
Scenario:
1. In record producer i have two fields in which field A' type is "lookup select box" and its populating few values based on reference qualifier of field A and currently has three values in it.
2. And second field B' type is select box and have 4 choices in it.
Requirement is to show only two values in field B based on when 1 value selected in field A and if other value selected in field A then in field B it should show other two choices.
Please help me with this requirement!
Thanks in advance!
Priyanka

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 08:01 AM
Hi,
You have to use client script for this requirement
use g_form.addOption for adding an option to the choice field
use g_form.removeOption for removing an option
Refer this article for reference
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 08:08 AM
Thanks for the response.
I used onchange client script but its not working as expected.
Lookupselect box: field A
Selectbox: field B
var a=g_form.getValue('lookupselect box field');
if(a=='value of lookupselect box field'){
g_form.removeOption('selectbox field',',choice value of selectbox');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 08:19 AM
add a alert inside if block and make sure it is getting printed
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 09:38 AM
Thanks you. Alert is working but its taking only sys id even i tried getDisplayValue then also its not working. Could you please help me to understand how to get display value from "lookup select bos"field.