How can i call a schedule class execute method from normal apex class or apex trigger. I also need to pass some variables like(daily,weekly,monthly) based on which i like to schedule the class like weekly or monthly or daily. Is it possible?
How can i call a schedule class execute method from normal apex class or apex trigger. I also need to pass some variables like(daily,weekly,monthly) based on which i like to schedule the class like weekly or monthly or daily. Is it possible?
Best Answer
I think you can use something like following:
and then call
or
or
String constant dailyCronExpression = '0 0 13 * * ?' means 'every day at 1 p.m.' String constant dailyCronExpression = '0 0 13 1 * ?' means 'every first day of month at 1 p.m.' String constant dailyCronExpression = '0 0 13 * * ?' means 'every first day of week at 1 p.m.'
Please mark this answer as accepted if you agree it accurately and precisely answers your question, please vote up this answer if you find it useful.