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
ganesh jadhavganesh jadhav 

Error: Schedulable class has jobs pending or in progress?

I am trying to Run Schedule job........but Schedulable class has jobs pending or in progress? This Error is occurs again and again, i have deleted the scheduler class and tried again still same problem occurs if have any suggetions please let me know...... here is my scheduler class for send Emails to employee on his birth day :-

 

global class BirthdayMailSend implements Schedulable
{
    global void execute (SchedulableContext ctx)
    {
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();    
    for ( Employee__c emp : [SELECT Id, Name,email__c,First_Name__c FROM Employee__c WHERE Birth_date__c = TODAY] )
    {
     mail.setSubject('New Employee Record Created..!');
     mail.setHtmlBody('Hello'+emp.First_Name__c+'!<br/>today is your birth day bhikarya cake kap nahi tar muskadin');
     mail.setToAddresses(new String[] {emp.email__c});
     Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });        
    }
    BirthdayMailSend mc = new BirthdayMailSend();
    String sch = '0 0,1 * * * *';
    system.schedule('Birthdaymail', sch, mc);
    }
}

Best Answer chosen by Admin (Salesforce Developers) 
Sridhar BonagiriSridhar Bonagiri

Hi,

 

I think there are already some jobs are in progress or scheduled for this job. try to delete them and schedule them again.

 

Regars,

Sridhar Bonagiri

All Answers

Vinit_KumarVinit_Kumar

Log a a case with salesforce support,they will help you in removing any stuck job.

Sridhar BonagiriSridhar Bonagiri

Hi,

 

I think there are already some jobs are in progress or scheduled for this job. try to delete them and schedule them again.

 

Regars,

Sridhar Bonagiri

This was selected as the best answer
ganesh jadhavganesh jadhav

Yes Done !!! got the success

Thank you So much :)