How to add an 'date>=today and date less than 20 days' type date query to a glideRecord


//--store the day_end in a configurable sys property, e.g. '20'
var day_end=gs.getProperty('sch.sitemigration.enddate'); //--set to integer 20
gs.print(day_end);
var day_end_minus= -Math.abs(day_end);
gs.print(day_end_minus);
//--gr is your gliderecord you are adding queries to:
var qc = gr.addQuery('u_scheduled_date', '<=', gs.daysAgo(day_end_minus));
qc.addCondition('u_scheduled_date', '>=', gs.daysAgoEnd(0));

gr.orderBy('u_scheduled_date');
gr.query();

Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue