I have a "GeoCoderSchedulable" class in a managed package. I want to schedule the class in my salesforce org by code, not by salesforce Scheduler GUI. I used the below code in Anonymous block to schedule but getting the below error - "Line: 1, Column: 1 Enclosing type for global methods in apex classes must be declared as global"
global class ScheduleGeoCoder implements system.schedulable{
GeoCoderSchedulable testobj = new GeoCoderSchedulable();
public String cronexpression = '0 0 0 ? * 1,2,3,4,5,7';
global void execute(SchedulableContext ctx) {
System.schedule('Account Geocoding Batch_New2', cronexpression, testobj);
}
}
Please let me know where is the issue in my code.