Encoded query filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 01:08 PM
Can someone show me how to filter records in contract table (ast_contract)
I want to build a encoded query to run scheduled job for contracts that will expire on 180 days and 365 days
I have the below script for 90th day
var cnt = new GlideRecord("ast_contract");
cnt.addEncodedQuery('endsRELATIVEGT@dayofweek@ahead@89^endsRELATIVELT@dayofweek@ahead@91');
cnt.query();
while (cnt.next()) {
gs.eventQueue('reminder_contract_90_days', cnt, cnt.number);
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 08:51 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2022 05:52 AM
Hi,
You need to use AND, not OR.
Please review my reply above as it was meant to be AND and if there's ever an OR, I call that out.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!