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

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

Hi All,
I was just trying to schedule my schedulable class 'Schedular_GlobalAppLogPurgeBatch' in Apex. That time I was facing this error.
Error : "Trigger must be associated with a job detail"

e.g.
Schedular_GlobalAppLogPurgeBatch globalPurgeBatchSchedular = new Schedular_GlobalAppLogPurgeBatch();
System.schedule('Global App Logs Purge ', '0 0 * * * ? *', globalPurgeBatchSchedular);

you can notice there is a space after "Global App Logs Purge ", when I removed this extra space from the name ("Global App Logs Purge") my class was scheduled as expected.

Corrected Space from code:
Schedular_GlobalAppLogPurgeBatch globalPurgeBatchSchedular = new Schedular_GlobalAppLogPurgeBatch();
System.schedule('Global App Logs Purge', '0 0 * * * ? *', globalPurgeBatchSchedular);

I hope this will help you.

Comments

Popular posts from this blog

Custom Setting Creation in Apex Test Class

System.AsyncException: The Apex job named is already scheduled for execution.

Salesforce Trace Log Query Using Apex

AJAX Toolkit Debug Shell

How to Query All the batch classes in your Salesforce Instance using APEX

Prefix List Of Salesforce Object

how to get object name from id / prefix value in salesforce

Creating Salesforce Developer Account

15 to 18 char ID Conversion in Apex