• Igor Filatov
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hello to everyone, today I create Schedulable Apex class to send emails after 1 minute if trigger fire, i programmed callout as:
 

ScheduleCasePostWithFile scheduleMail = new ScheduleCasePostWithFile(C[0], F,'temp' + string.valueOf(DateTime.now()));
String CRON_EXP = string.valueOf(DateTime.now().addMinutes(2).format('s m h d M ? y'));
System.schedule('temp' + string.valueOf(DateTime.now()), CRON_EXP , scheduleMail);

But I am dealing with the problem "execution of AfterInsert caused by: System.AsyncException: Based on configured schedule, the given trigger will never fire. ()", if I change CRON_EXP to hardcoded nearest minute, all OK, so did anyone get this problem before and know how to deal with this?

Thanks.

Hello to everyone, today I create Schedulable Apex class to send emails after 1 minute if trigger fire, i programmed callout as:
 

ScheduleCasePostWithFile scheduleMail = new ScheduleCasePostWithFile(C[0], F,'temp' + string.valueOf(DateTime.now()));
String CRON_EXP = string.valueOf(DateTime.now().addMinutes(2).format('s m h d M ? y'));
System.schedule('temp' + string.valueOf(DateTime.now()), CRON_EXP , scheduleMail);

But I am dealing with the problem "execution of AfterInsert caused by: System.AsyncException: Based on configured schedule, the given trigger will never fire. ()", if I change CRON_EXP to hardcoded nearest minute, all OK, so did anyone get this problem before and know how to deal with this?

Thanks.