I have a batch class in which on a specific condition I call system.scheduleBatch().I am passing the instance of the same batch class to system.scheduleBatch().
global class MyBatch implements Database.Batchable<ID>, Database.AllowsCallouts, Database.Stateful{
//some code
public static ID myMethod()
{
MyBatch myBatchObj = new MyBatch ();
if(condition1)
{
return System.scheduleBatch(myBatchObj ,'MyBatch', 1, 1);
}
}
}
When I execute this class via code it works but when this is executed through managed-beta package Schedule job is visible on UI and it is shown started but does not executes. I also tried on released package the result was same.Its only working upon unmanaged package and code.
public static Id myMethod()
need to be global?