For example, I have some DateTimeField__c, and if DateTimeField__c - NOW() = 11 (hours), I should send an email. Trigger is not a variant, because I can't check with it a formula field. A Scheduled class is a bad variant too. I can't always run it: there is already a lot of logic with callouts and schedules. Can you advise something?


You should use Workflow Rule here, not Apex. Specifically, Add a Time-Dependent Action to Your Workflow Rule:

Time-dependent actions are executed at a specific time, such as 10 days before a record’s close date. When that specific time passes, the workflow rule re-evaluates the record to make sure that it still meets the rule criteria. If the record does, the workflow rule executes those actions.

  • I think it will not work with a lot of messages. Or it will? What are day's limits for it for, e. q., enterprise edition? – Apelsinova Dec 4 '19 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.