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
Preetham ThummalaPreetham Thummala 

schedule apex

Can we manually schedule the apex class?
Amit Chaudhary 8Amit Chaudhary 8
Please try below example:-

Example 1:-
DateTime currentDateTime=System.now().addMinutes(1);                            
        String nextScheduleTime=String.valueof(currentDateTime.second()) +' '+String.valueof(currentDateTime.minute())+' '
                                +String.valueof(currentDateTime.hour())+' '+String.valueof(currentDateTime.day())+' '
                                +String.valueof(currentDateTime.month())+' ? '+String.valueof(currentDateTime.Year());
        
        TestSchedulableClass testObj = new TestSchedulableClass();
		
        system.schedule('Scheduled JOB', nextScheduleTime, testObj);

Example 2:- 
String chron1 = '0 1 * * * ? *';      
System.schedule('Every 1 min', chron1, new JOBNAME());

Please let us know if this will help you.

Thanks,
Amit Chaudhary
Vivek DeshmaneVivek Deshmane
Please check below step.
Setup -> Develop -> Classes

You will see a "Schedule Apex" button. You can set up the timing from there.

http://salesforce.stackexchange.com/questions/3593/scheduling-an-apex-job-through-the-ui

Best Regards,
-Vivek