Thursday, December 08, 2016

System.AsyncException: trigger must be associated with a job detail

System.AsyncException: trigger must be associated with a job detail
I am writing test class for schedule and bump into this exception.The reason is , make sure no space at jobName. The class can be call by :

System.schedule(jobName, cronExpression, schedulableClass) ;


Notice this will throw the exception . 'Opp_Update_Schedule 5.00 '


      // Schedule the test job
      String jobId = System.schedule('Opp_Update_Schedule 5.00 ',
                        CRON_EXP_DAY, 
                        new Opportunity_Update_Schedule(100));

This will not throw exception :'Opp_Update_Schedule 5.00'
      // Schedule the test job
      String jobId = System.schedule('Opp_Update_Schedule 5.00',
                        CRON_EXP_DAY, 
                        new Opportunity_Update_Schedule(100));
Have a nice day.

No comments:

Post a Comment