query a related list using RLQUERY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 03:01 AM
Hi,
I built a filter on a before query business rule on the sc_request_item. The filter is the following:
var filterConditionSCReqIt = "opened_by=" + utenteCorrScReqIt + "^ORwatch_listCONTAINS" + utenteCorrScReqIt + ' '^ORassignment_groupIN' + scri1_listaGruppiUtenteCorrente + '^ORrequest.assignment_groupIN' + scri1_listaGruppiUtenteCorrente;
Then i would like to add to the above filter this condition:
filterConditionSCReqIt+='^OR^RLQUERYsc_task.request_item,>=1^assignment_group.nameIN' + scr2_listaGruppiUtenteCorrenteSCR + '^ENDRLQUERY';
The point is that the second condition must be concatenated to the first one using an OR and not and AND operator given by default!
How can I fix this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 05:57 AM
Hi Andrea,
Following links should be helpful to you:
https://servicenowgems.com/2015/07/29/tip-for-creating-complex-before-query-business-rules/
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
09-22-2017 12:08 AM
Well I will simplify my question if i try to build the filter after having activated listV3 plugin, It's not possible to concatenate the related list filter to the 'basic' one using an OR operator.
That's my problem.
And the final result is:
assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^RLQUERYsc_task.request_item,>=1^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^ENDRLQUERY
which is with the AND operator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 01:51 AM
Is there any update to that? Is possible what @andreazaffaroni mentioned in the last comment?
What about related list query as OR condition? I'd like to check condition on table and if it's not met to have condition on related table. Currently Related List Queries work only as AND statement (if we include condition on table and additionally on related list).