The Zurich release has arrived! Interested in new features and functionalities? Click here for more

query a related list using RLQUERY

andreazaffaroni
Tera Expert

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?

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Andrea,



Following links should be helpful to you:



https://servicenowgems.com/2015/07/29/tip-for-creating-complex-before-query-business-rules/


Query Business Rule


https://www.servicenowguru.com/scripting/business-rules-scripting/controlling-record-access-before-q...



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


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.


filtro.png


And the final result is:


assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^RLQUERYsc_task.request_item,>=1^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^ENDRLQUERY


which is with the AND operator


Jonna007
Tera Contributor

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).