- 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 06:37 PM
Can you give an example of what this would look like or provide a link to a similar one?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:43 AM
Hi,
Example below.
Also note, this solution doesn't prohibit you to select the same users if you select the second variable before the first one, in that case, you will need to make some adjustments.
But I'm sure you get the general idea.
Script include (just change the query to whatever your requirement looks like:
Reference qualifier on variable on catalog item (first_user and then second_user variable):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 01:19 PM
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 10:43 AM
Hi Wright,
Did the above solution worked for you. I do have the same requirement now.
Regards,
Navyaa