[SalesForce] Time-based workflow email notification alerts to customers

So I've been reading up on Workflows, Triggers and Email Alerts and what I want to do appears possible without having to write custom Apex stuff.

Our objective is to send email reminders to customers when their yearly maintenance contrats are about to expire.

So I have created a custom field in the Standard object Accounts, called Maintenance Start Date__c. And created a Workflow rule (Create>Workflow & Approvals>Workflow Rules) for Account with a Rule Criteria formula that should evaluate to true as the DATE field is NOT null.

ex. NOT( ISNULL( Maintenance__c ) ).

My logic is that a Time-Dependent Workflow Action of say 345 Days After Account: Maintenance start date will trigger an email alert. For the email addresses I'm starting with just a test email to myself as a User.

Evaluation Criteria :  created, and any time it’s edited to subsequently meet criteria

But the alert is not working when I enter a date in the Maintenance Start Date__c field which is backdated to over 345 days. Both workflow and alert are "Active". Any advice would be appreciated.

Best Answer

Preamble (altered to reflect comment trail)

With a rule NOT( ISNULL( Maintenance__c ) ) and workflow evaluation criteria of:

Evaluation Criteria :  created, and any time it’s edited to subsequently meet criteria

The workflow rule only executes if the value of the field changes from null to nonNull or when the record is created.

The workflow will not evaluate at all if the Maintenance__c changes from one non-null value to another non-null value as that won't "subsequently meet criteria" (true is still true). Note, for time-based workflows, the Every time it is edited evaluation radio button is not available.

Once the time-based workflow is entered for the object, the object stays in that workflow until the time-based condition is no longer true (maintenance start date becomes null) or the time trigger finally happens (345 days after account.maintenance_start_date__c). If the maintenance start date is changed on the Account, the time based trigger adjusts accordingly per the doc:

What happens if I update the value of a date field used in a time trigger? If you update the date field used in a time trigger, Salesforce recalculates the time trigger as long as the time trigger has not yet fired and the recalculation does not reschedule the time trigger to a date in the past.

For example, if a workflow rule alerts the opportunity owner seven days before the opportunity close date and the close date is set to 2/20/2008, Salesforce sends the alert on 2/13/2008. If you update the close date to 2/10/2008 and the current date is 2/2/2008 or before, Salesforce reschedules the alert for 2/3/2008. The evaluation date of pending actions is ALWAYS reevaluated and updated if necessary irrespective of the rule criteria. Of course, if the rule is evaluated to false, it does not matter as the actions are removed from the queue.

If you were backdating to a date in the past, per the doc, the time trigger does not adjust

Related Topic