- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 11:58 AM
I have a form with 3 reference fields. The idea is to not have the user select the same option in any of the 3 fields:
So if the user selects "Financial Services" for Primary, they should not be allowed to select the same for Secondary or Tertiary. Therefore I would like to remove those options from these reference fields.
I created a Catalog Client Script onchange of the Primary Specialty field
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.removeOption('secondary_specialty_en',newValue);
g_form.removeOption('tertiary_specialty_en',newValue);
}
It does nothing... the option still exists... Not sure what I am doing wrong. Please help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 12:02 PM
Hi,
Removing options will not work on a reference field. It's only valid if it were a choice field.
In this case you would need to create an advanced reference qualifier, and a script include on all three fields, and use the input value to determine which results should be displayed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 12:02 PM
Hi,
Are the values in Secondary and Tertiary coming from any reference field or from choice field.
Regards,
Deepankar Mathur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 12:53 PM
All three fields are Reference fields pointing to the same source.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 12:59 PM
Hi MWrite,
If they are referencing to some table, you would need to create a advanced reference qualifier. Since g_form.removeOption will not work, as it only works if you have choices.
Regards,
Deepankar Mathur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 12:02 PM
Hi,
Removing options will not work on a reference field. It's only valid if it were a choice field.
In this case you would need to create an advanced reference qualifier, and a script include on all three fields, and use the input value to determine which results should be displayed.