
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 09:49 PM
Hello Community,
I have reference field with a reference qualifier of:
Valid
javascript: "contractLIKE" + current.contract.getDisplayValue();
I need help with adding an OR condition that dot-walks to another reference field [sys_user]--get users with the company matching the current company in the record. I need
Invalid
javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.companyLIKE" + current.company.getDisplayValue();
Thank you.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 09:58 PM
Hi,
update as this
javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.company.nameLIKE" + current.company.getDisplayValue();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 09:58 PM
Hi,
update as this
javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.company.nameLIKE" + current.company.getDisplayValue();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 11:00 PM
In the above scenario, the field is referencing Users Covered[clm_m2m_contract_user], which has a Contract field. The OR part was meant to get results from the User [sys_user] table.
Is it possible to have a single reference field that can reference two or more tables and show all matching results? Basically, combined list and independent of each other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 11:33 PM
1 reference field can refer only 1 table at a time because that is how it is configured in dictionary
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 10:32 PM
Hi
You can try below.
javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.companyLIKE" + current.company;
Instead of going for display value, we should use sys id's for comparison as display name could have multiple records.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP