function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Long Nguyen 19Long Nguyen 19 

How to start schedule job

Hi experts,

I have written a schedule job which should run every 6 minutes/day. My question is how can i start this job, do we need to setup anything in Setup?
global class ScheduleAccountConvertion implements Schedulable{
    
    global void execute(SchedulableContext sc){
    
		AccountConvertion acc = new AccountConvertion();
        acc.accountConvertion();
        
        System.schedule('Scheduled Job 1', '0 0 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 2', '0 6 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 3', '0 12 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 4', '0 18 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 5', '0 24 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 6', '0 30 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 7', '0 36 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 8', '0 42 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 9', '0 48 * * * ?', new ScheduleAccountConvertion());
        System.schedule('Scheduled Job 10', '0 54 * * * ?', new ScheduleAccountConvertion());
        
    } 
}

 
sandeep sankhlasandeep sankhla
Hi Long,

You can simply call this class and execute method from developer console to schedule this ..

P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer. because you have only wriiten the coe to schedule..but to schedule this code should execute once..so call method from developer consle..

Thanks,
Sandeep
Salesforce Certified Developer