0

I have a requirement to send an email after x days when status changes to y Meanwhile if the status has changed to another value ,can i stop the scheduled email delivery after x days ?

I am using process builder...

2

As per Salesforce docs:

Will the pending actions in the queue ALWAYS trigger? No. Time-dependent actions remain in the Workflow Queue until processed or the rule criteria for the Workflow Rule are evaluated as "false." If a record no longer matches the rule criteria when the rule is evaluated, Salesforce removes the time-dependent actions queued for that record.

I never tested this with PB but I think PB should give same output as well. So, in this case, you don't need to do anything Salesforce already handle it.

Time-Based Workflow FAQ

0

If a record no longer matches the criteria, Salesforce removes the scheduled actions for the record from the queue. As per the salesforce documentation related to How Does Salesforce Process Scheduled Actions?

What Happens When the Field Values Change?

  • For processes that start when a record is created or edited, scheduled actions remain in the queue only as long as the criteria for those actions are still valid. If a record no longer matches the criteria, Salesforce removes the scheduled actions for the record from the queue.
  • For processes that start when a record is created, Salesforce never reevaluates the record with that process. Scheduled actions remain in the queue, even if the record no longer meets the associated criteria when the scheduled actions are executed.
  • If you change the referenced field value and the schedule hasn’t been processed, Salesforce recalculates the schedule associated with the field. For example, a process is configured to email an opportunity owner 7 days before the opportunity close date. The close date is set to 2/20/2014. Salesforce processes the schedule on 2/13/2014 and sends the email. If the close date is later updated to 2/10/2014 and the schedule hasn’t been processed yet, Salesforce recalculates the schedule and sends the email on 2/3/2014. If Salesforce recalculates the schedule to a date in the past, it executes the associated actions shortly after you save the record.

  • If the record or object that the schedule is associated with is deleted, Salesforce never processes the schedule.

For more details go through Salesforce Process Scheduled Actions

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.