
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 03:26 PM
Hello Community,
I've created a relationship where 'Applies to table' and 'Queries from table' are the same tables.
This query works.
current.addQuery('customer', parent.customer);
Next, I'd like to include or statement and query a list field
current.addQuery('customer', parent.customer);//or...
current.addQuery('customer', parent.u_related_customer);//u_related_customer list field
Thank you!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 02:04 AM
try this once
current.addQuery('customer', parent.customer).addOrCondition('u_related_customer', 'LIKE', parent.customer);
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
03-09-2022 01:43 AM
Hi,Try whether this method is feasible
addEncodedQuery(String query)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 02:00 AM
Hi,
you cannot compare reference field with list field directly
you need to query and check
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
03-09-2022 02:04 AM
try this once
current.addQuery('customer', parent.customer).addOrCondition('u_related_customer', 'LIKE', parent.customer);
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
03-09-2022 10:44 AM
I reversed the last condition and it produced results.
current.addQuery('customer', parent.customer).addOrCondition('customer', 'LIKE', parent.u_related_customer);
However, it does not produce results when there is more than one (1) entry in u_related_customer list field.
Regards,
Desmo