plugins.scheduler.addJob function not working.

Hi All,

I was just testing the scheduler plugin …, but it is not working .

var startDate = new Date();
startDate.setTime(startDate.getTime()+20000);
var endDate = new Date(startDate.getTime()+100000);
plugins.scheduler.addJob('in20seconds',startDate,'showTestDialog',20000,40,endDate)

showTestDialog=Global Function name.

The error i got:

Can't find method com.servoy.extensions.plugins.scheduler.SchedulerProvider.js_addJob(string,java.util.Date,string,number,number,java.util.Date).
org.mozilla.javascript.EvaluatorException: Can't find method com.servoy.extensions.plugins.scheduler.SchedulerProvider.js_addJob(string,java.util.Date,string,number,number,java.util.Date).

But the plugin is inside the plugin folder.

Please help.

Thanks
DP

The error doesn’t say that the plugin is missing but that you are calling the method wrong.

Your mistake is the way you pass the global method. You are passing a String, not a Function (method). So change it to

plugins.scheduler.addJob('in20seconds',startDate,globals.showTestDialog,20000,40,endDate)