Run schedule Job every 2 weeks

renukaca
Kilo Contributor

How to set a condition to run a schedule job every two weeks?

5 REPLIES 5

Shishir Srivast
Mega Sage

you can schedule you job to run daily but in GlideRecord query you can check the condition if it's 15 days as compare the updated ya other date field then execute the code. example:



gr.addQuery('sys_created_on','<',gs.daysAgo(15));


Thanks,This is to get the records which created from two weeks before, But   we want this schedule job to run automatically every two weeks can you suggest how to set the condition for that.?


find_real_file.png


You have to add choice of 2 week


Thank you,


vishu


I don't think OOB we can do this, but was thinking if we can schedule the job for every week and then let's just put the condition to check the if the created date in sys_trigger table is less than 14 days for that particular schedule then let's not trigger the job.



Note: Haven't tested but just a thought if we can try in this way and if this helps.