Thursday 12 October 2023

Error : "Trigger must be associated with a job detail"




My_SchedulerClass sc = new My_SchedulerClass ();
String cronExp2= '0 16 09 * * ? *';
String JobId = system.schedule('Oppy_Scheduled0916 ', cronExp2, sc);


In the above code, there is a white space 'Oppy_Scheduled0916 ', when removed this extra space from the system.schedule ("Oppy_Scheduled0916") my class was scheduled as expected.