{div:style=display:none}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR{div}
{div:id=description}{note:title=Where is the method executed?}The scheduled methods are executed in the client in which they are started. This means that if the client is closed, the scheduled method(s) will not run anymore. See [Batch Processors| Batch Processor] for information how to continuously run methods in the background, in a client that will not be closed (automatically){note}{div}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#addCronJob]\(jobname, cronTimings, method)
Adds a cron job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addCronJob]\(jobname, cronTimings, method, startDate)
Adds a cron job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addCronJob]\(jobname, cronTimings, method, startDate, endDate)
Adds a cron job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addCronJob]\(jobname, cronTimings, method, startDate, endDate, arguments)
Adds a cron job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobname, startDate, method)
Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobname, startDate, method, repeatInterval)
Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobname, startDate, method, repeatInterval, repeatCount)
Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobName, startDate, method, repeatInterval, repeatCount, endDate)
Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobname, startDate, method, repeatInterval, repeatCount, endDate, arguments)
Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addJob]\(jobname, startDate, method, arguments)
Adds a job to the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getCurrentJobNames]\()
Returns an array with the current jobs.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getLastRunJobName]\()
Returns the last job run from the scheduler.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeJob]\(jobname)
Removes a job from the scheduler.{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addCronJob-String_String_Function}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// see: http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for more info
// add a job that runs every 20 minutes after the hour (0,20,40)
plugins.scheduler.addCronJob('20mins','0 0/20 * * * ?',method)
// add a job that runs every day at 23:30 between now and 5 days from now
var dateNow = new Date();
var date5Days = new Date(dateNow.getTime()+5*24*60*60*1000);
plugins.scheduler.addCronJob('23:30','0 30 23 ? * *',method,dateNow,date5Days)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCronJob-String_String_Function_Date}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method, startDate){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
\{[Date]} startDate
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// see: http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for more info
// add a job that runs every 20 minutes after the hour (0,20,40)
plugins.scheduler.addCronJob('20mins','0 0/20 * * * ?',method)
// add a job that runs every day at 23:30 between now and 5 days from now
var dateNow = new Date();
var date5Days = new Date(dateNow.getTime()+5*24*60*60*1000);
plugins.scheduler.addCronJob('23:30','0 30 23 ? * *',method,dateNow,date5Days)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCronJob-String_String_Function_Date_Date}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method, startDate, endDate){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
\{[Date]} startDate
\{[Date]} endDate
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// see: http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for more info
// add a job that runs every 20 minutes after the hour (0,20,40)
plugins.scheduler.addCronJob('20mins','0 0/20 * * * ?',method)
// add a job that runs every day at 23:30 between now and 5 days from now
var dateNow = new Date();
var date5Days = new Date(dateNow.getTime()+5*24*60*60*1000);
plugins.scheduler.addCronJob('23:30','0 30 23 ? * *',method,dateNow,date5Days)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCronJob-String_String_Function_Date_Date_ObjectArray}{tr:id=name}{td}h6.addCronJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addCronJob{span}{span}\(jobname, cronTimings, method, startDate, endDate, arguments){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[String]} cronTimings
\{[Function]} method
\{[Date]} startDate
\{[Date]} endDate
\{[Object]\[]} arguments
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// see: http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for more info
// add a job that runs every 20 minutes after the hour (0,20,40)
plugins.scheduler.addCronJob('20mins','0 0/20 * * * ?',method)
// add a job that runs every day at 23:30 between now and 5 days from now
var dateNow = new Date();
var date5Days = new Date(dateNow.getTime()+5*24*60*60*1000);
plugins.scheduler.addCronJob('23:30','0 30 23 ? * *',method,dateNow,date5Days)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,method,20000,40,endDate)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, repeatInterval){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,method,20000,40,endDate)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number_Number}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, repeatInterval, repeatCount){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
\{[Number]} repeatCount
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,method,20000,40,endDate)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number_Number_Date}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobName, startDate, method, repeatInterval, repeatCount, endDate){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobName
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
\{[Number]} repeatCount
\{[Date]} endDate
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,method,20000,40,endDate)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_Number_Number_Date_ObjectArray}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, repeatInterval, repeatCount, endDate, arguments){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Number]} repeatInterval -- ms
\{[Number]} repeatCount
\{[Date]} endDate
\{[Object]\[]} arguments
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,method,20000,40,endDate)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addJob-String_Date_Function_ObjectArray}{tr:id=name}{td}h6.addJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addJob{span}{span}\(jobname, startDate, method, arguments){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
\{[Date]} startDate
\{[Function]} method
\{[Object]\[]} arguments
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// add a job that runs at the given date (20 seconds in the future)
// and repeats that every 20 seconds for 40 times or the enddate is reached (0 for no repeats = just one call)
var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,method,20000,40,endDate)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentJobNames}{tr:id=name}{td}h6.getCurrentJobNames{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]\[]{span}{span:style=font-weight: bold;}getCurrentJobNames{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
plugins.scheduler.getCurrentJobNames()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getLastRunJobName}{tr:id=name}{td}h6.getLastRunJobName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getLastRunJobName{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
plugins.scheduler.getLastRunJobName();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeJob-String}{tr:id=name}{td}h6.removeJob{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}removeJob{span}{span}\(jobname){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} jobname
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// removes a job 'myjob' from the scheduler
plugins.scheduler.removeJob('myjob');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}