Add addOrCondition to EncodedQuery does not seem to work.

Meloper
Kilo Sage

Hello Community,
Is it possible that you cannot add an "addOrCondition" to an EncodedQuery?

So I am talking about something like this:

var qc =  current.addEncodedQuery("u_xydate@dayofweek@ago@90");
qc.addOrCondition('active', true);

 

Of course I can include the OR directly in the encoded query.... is that maybe the reason why it doesn't work?

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi,

In EncodedQuery should add/concat the query instead of addQrCondition.

It is supported for addQuery only.

 

You can refer this article nicely written by @Paul Morris.

How To Write GlideRecord Queries Like A Pro

 

Thanks!

Sagar Pagar

The world works with ServiceNow

View solution in original post

3 REPLIES 3

Aman Kumar S
Kilo Patron

Hey,

Please include addorcondition directly in addEncoded query:

var qc = current.addEncodedQuery("u_xydate@dayofweek@ago@90^ORactive=true");

Best Regards
Aman Kumar

Sagar Pagar
Tera Patron

Hi,

In EncodedQuery should add/concat the query instead of addQrCondition.

It is supported for addQuery only.

 

You can refer this article nicely written by @Paul Morris.

How To Write GlideRecord Queries Like A Pro

 

Thanks!

Sagar Pagar

The world works with ServiceNow

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

yes the function doesn't seem to show when you use encodedQuery

Regards
Ankur

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