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.

2 comments:

  1. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    software testing course in chennai

    ReplyDelete
  2. Hey Nice Blog!! Thanks For Sharing!!!Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
    Web Design Training

    ReplyDelete