HI I have the following field value.
- type (pick-list) values [daily, weekly]
- Count (number).
- end date If I choose daily and 2 in the above field. two mail should send to the owner. till the endate field.
How to achieve this?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You can achieve this by adding a 4th field: "Next Email" (Date Time). There you can store a date at which you want to send the next email.
Create a workflow (time-based). Add a workflow action to send the email.
Create a scheduled batch job. (And run your scheduled batch job every 15 min). Query all records
WHERE NextEmail__c < Now. For each of these records, you can set a new "Next Email Date" based on your 3 fields above.
Create a trigger within the trigger you can update the next Email field based on your criteria. In a second step, you schedule a job (through your trigger).
The scheduled job updates the Next Email Field based on your criteria and send a new mail.