- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 04:05 PM
I have a scheduled job that runs daily, checking for records in a table that need to be processed.
The parameters are that the field "u_reminder_complete" is FALSE, and that the sys_created_on date is 30 days ago.
This scheduled job works perfectly when I comment out the eQuery line.
I've tried every dang permutation of this query that I can think of and I've scoured both the product docs and the community and nothing I have tried works.
Thanks in advance.
Here's the code:
var eQuery = "sys_created_onRELATIVEGE@dayofweek@ago@30";
var app = new GlideRecord('u_reboot_exception_expiration');
app.addQuery('u_reminder_complete','false');
//app.addQuery('sys_created_on','>','gs.daysAgo(30)');
app.addEncodedQuery(eQuery);
app.query();
while(app.next()){
//gs.eventQueue('open.costpoint.reminder', app, app.approver);
gs.log('found a record ' + app.u_computer_number);
var cart = new Cart();
var item = cart.addItem("319bedccdbdeaf00f0ad6f13ca9619f0"); //reboot removal
cart.setVariable(item, "rfw_req_name6", app.u_employee_name);
cart.setVariable(item, "rfw_req_short6", "Remove Reboot Exception for"+app.u_computer_number);
cart.setVariable(item, "rfw_req_detail6", app.u_computer_number + ' - It has been 30 days since this exception was set. IT will now remove the reboot exception from this computer.');
cart.setVariable(item, "rfw_req_assgGroup6", "0ad44fd345f7e00072f83215afc7a609"); //Security
cart.placeOrder();
app.u_reminder_complete = true;
app.update();
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 02:35 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 02:35 PM
Can you try this query
sys_created_onRELATIVELE@dayofweek@ago@30
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 02:49 PM
Interesting. That got both of the items with a created date of 12/8 AND the one with the 12/10 date. We may be okay on that because it probably falls within 24 hours of the 30 day mark.
I changed the created date for that one from the 10th to the 11th, ran it again, and it only got both of them from the 8th. Which is what I wanted!
I think this will work!
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:04 AM