Friday, March 22, 2013

SaleForce: Exception on installing scheduler

     I have to install two scheduler jobs on Saleforce one after another. The first one was installed successfully with out any error. While installing the second one I meet an exception:

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

and my apex code respectively as follows

String sch = '0 0 20 1 * ? *';
System.schedule('My scheduler1', sch, new mySchedulerClass1());

String sch = '0 0 20 12 * ? *';
System.schedule('My scheduler2 ', sch, new mySchedulerClass2());

   I am totally confused and check my classes for any chance of triggers. Finally I found that issue is due to the extra space character(' ') at the end of scheduler name "My scheduler2 ".