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
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12 

System.AsyncException

Hi all,
I am getting this error when i am executing Test class.
System.AsyncException: The Apex job named already scheduled for execution.

Thanks
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12
Can some one help me urgetn..
Nilesh JayswalNilesh Jayswal
The error occur when an Apex job is already scheduled with the same name as you are giving in your test class. Please change the name in test class. 
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12
Hi Nilesh,

Thanks for given reply. I am executing test class with different names only.

Thanks
Nilesh JayswalNilesh Jayswal
Hi kumar, 

Can you please give your test code snippet here where you are getting this error.

Thanks
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12
Hi Nilesh,

I am getting this error on Test class
@istest
class TestEmailNotification {
    static testmethod void testEmailNotification() {
        System.schedule(  'Demo 1', '0 0 0 * * ?', new EmailNotification() );
        System.schedule(  'Demo 2', '0 0 0 * * ?', new EmailNotification(1) );
    }
}
Nilesh JayswalNilesh Jayswal
Hi Kumar,

Please check in the 'All Scheduled Jobs' if there is any scheduled job with name 'Demo 1' or 'Demo 2' is exist. May be it will resolve your problem.

Thanks
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12
No Nilesh... I checked
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12
Hi all,

Any other help please..