- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 07:54 AM
Hello All
I am running script include function and just notice that
this code lines sequence does not filter for active records
var gr = new GlideRecord(someTable);
gr.addActiveQuery();
gr.addEncodedQuery(strQuery); //
gr.query();
but this one does
var gr = new GlideRecord(someTable);
gr.addEncodedQuery(strQuery);
gr.addActiveQuery();
gr.query();
I could not find any docs regarding this
Does anyone have the same experience? Where could I read about it?
thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 08:43 AM
Does the encoded query contain an or condition? Or (multiple) layered and conditions?
Then it would matter if the active=true is at the beginning. Or at the end and then part of an or condition for example.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 08:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 08:22 AM
Hello Kieran
Thank you for your reply.
The query is dynamic and it is complicated.
I run the same test as you did and final query with active=true at the end of string brings correct records, but when it is in the beginning - no filer for active
What in query string could interfere to make final query not to select active records?
any ideas? 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 09:02 AM
Are you able to paste the query string in here?
It'll depend on whether your condition contains an OR condition or a contradictive active=false statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 08:19 PM
What is the playground you use to run the code?