Search This Blog

Monday, 23 September 2019

Scheduled Apex Class After nth Minute

Below is apex code for scheduled your schedulable class after nth minute, just write the below code in developer console and execute it.

 Integer intMinute = 1;
ScheduleClass objScheduleClass = new ScheduleClass();
String strCronExpression = '0 '+String.ValueOf(DateTime.Now().AddMinutes(intMinute).Minute())+' * * * ?';
String strJobId = system.schedule('Test Job', strCronExpression, objScheduleClass);

**ScheduleClass = Apex class name which you want to schedule

THANK YOU

1 comment:

  1. Latest Certification Dumps of Salesforce , Amazon , IBM , Microsoft, SAP, Oracle , VMware available at https://www.ebsose.com or mail us at ebsosedotcom@gmail.com or certificationdirectdumps@gmail.com for any dumps / Superbadge /Development project queries . Get Fast replies and our team is available 24/7 . Success rate is 99.99% , so hurry and ping us .
    Reach out at ebsosedotcom@gmail.com for any development project or superbadge help required in salesforce or any other technology .

    ReplyDelete