var lastUpdated=getLatestRecord('azure_billing_table');
var luDate=(new GlideDateTime(lastUpdated));
gs.print('lastUpdated='+luDate);
gs.print(luDate < gs.monthsAgoStart(6))
gs.print(luDate > gs.monthsAgoStart(6))
function getLatestRecord(tableName){
var dReturn;
var gr = new GlideRecord (tableName);
gr.orderByDesc('sys_created_on');
gr.setLimit(1);
gr.query();
if (gr.next()){
dReturn=gr.sys_created_on;
}
return dReturn;
}
Comments
Post a Comment