EDIT: I should have mentioned that the main problem is not to make a time dependent workflow rule, the problem is that I want this to work for all existing contracts that most likely will never be updated before a customer actually renews their contract. I.e., I want a workflow rule or process builder process to run on existing objects that will not receive an edit, OR: bulk edit a dummy field for all existing objects with another tool (currently verifying dataloader.io) to ensure that the workflow rule time-dependent action will run for all existing contracts.
EDIT2: The solution was a combination of the answer by gNerb, David Reed, and a separate post from SalesForce forums that gave a suggestion of using dataloader.io. I created a dummy-field that was a checkbox, and used Dataloader.io to export all contracts, then change the value of the checkbox and do an update. This makes all objects update, and therefore SF recognises all records as edited, meaning the workflow rule will fire for all contracts.
Accounts have Maintenance and Support Contracts that they renew every year. Currently, these are being tracked manually. The goal is to automatically send a mail to the Account Owner as soon as TODAY() becomes < X days before renewal.
I have a process builder that triggers on Contract Create or Edit, and has Recursion checked. This then has a criteria where the following formula should evaluate to TRUE:
AND(ISCHANGED([Contract].Notify_2_Months__c), [Contract].Notify_2_Months__c = TRUE)
The Notify_2_Months__c is a custom checkbox on the Contract layout. I use this criteria to make sure that the checkbox has changed and that my custom field is true, and I do this in order to avoid unnecessarily triggering mails for situations where changes to other fields are made manually, for example changing the amounts or names etc.). This box is checked when a Workflow Rule runs. The workflow rule is set to the following:
- Evaluation Criteria: Evaluate the rule when a record is created, and any time it's edited to subsequently meet criteria
- Rule Criteria: TODAY() < EndDate - 60 (this is to ensure that changes to old contracts or contracts that expire very soon, for example changing of names, changing of values etc., does not trigger a new mail)
- Time-dependent workflow actions: 60 Days Before Contract: Contract End Date
- Field update: my custom field
If I manually check this box for a contract, I receive the mail notification from the Process Builder properly. However, if I create a dummy contract with all the necessary fields and let it sit for a day, the checkbox is checked over-night, and the "last modified" section will correctly update to the current date of that contract, but no mail is sent. I find this baffling because SF properly recognises that the record has been changed, but for some reason it doesn't send a mail when the workflow rule is the one checking the box.
Any ideas of what I need to do here? I found a similar question that went the APEX route, but I'd prefer this to be possible without going down that road (i.e., using Workflow Rules and Process Builder). I also thought that this ought to be possible using only workflow rules but I didn't come up with any solution for that just yet. All help is appreciated!