I have a situation where I need to pass a string to schedulable controller from batch or any apex controller. I see that we can do it using public constructor in schedulable implementation. Please let me know how can I pass a String parameter to schedulable controller. I tried below code but I am getting error.
Dependent class is invalid and needs recompilation: Class BatchControllerQueingCalls : Constructor not defined: [schedulerQueingCalls].Constructor()
global class schedulerQueingCalls implements schedulable{
global String sObjectName;
public schedulerQueingCalls(String objName){
this.sObjectName = objName;
}
global void execute(SchedulableContext sc){
BatchControllerQueingCalls getRecs = new BatchControllerQueingCalls(''+sObjectName);
database.executeBatch(getRecs);
}
}
}
if we do the same in a Batch controller, it is working fine without any issues.
Also, how the global variable values passes to Execute method in scheduler..