- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 12:51 PM
Hi,
I have two reference fields that are for users, and I would like for the second reference field not to accept the same value that has been chosen in the first reference field.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 01:50 PM
Please have this onChange() client script on second reference field.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var first_user = g_form.getValue('first reference field name'); //Update the field name here
if(first_user == newValue)
{
alert('User can not be the same');
g_form.clearValue('second reference field'); //Update the field name here
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 01:38 PM
Hi Eliana,
i have two fields on my change form in the same fashion as what you have mentioned and i am not getting the issue. Do you have any attributes on both the columns or any script that might be autopopulating? Out of the box you should not be having this issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 01:50 PM
Please have this onChange() client script on second reference field.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var first_user = g_form.getValue('first reference field name'); //Update the field name here
if(first_user == newValue)
{
alert('User can not be the same');
g_form.clearValue('second reference field'); //Update the field name here
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 02:15 PM
Thanks so much Shishir