0

I am looking to put in a solution as follows;

  1. Schedule Apex that runs once a day and updates a flag in several hundred records
  2. Depending on the status of the flag, I will launch a flow that sends an email to a customer

or, would it be better to use a loop within a flow to send the emails?

Not sure of the best way, considering the number of flows that may simultaneously run?

thanks

2
  • If you're going to call flow in the apex transaction then you will have to consider all the Per Transaction Flow limits which are following - help.salesforce.com/… Apr 24, 2020 at 6:07
  • hi Naval. I'm not calling a flow with Apex. I am executing an update to records with a flag. The Process Builder will respond if the record changes. I think my understanding is correct :-) thanks. Apr 24, 2020 at 9:28

1 Answer 1

0

Use a Process Builder or Autolaunched Flow to send the emails, and then your Scheduled Apex simply needs to update the flag. You could go about a more complicated procedure, but why overcomplicate things? Manually launching the flow means you'd want to aggregate the IDs together, and do the process entirely in the flow. This could work, but I feel it's probably unnecessarily complicated when a Process Builder could do the same thing.

3
  • thanks sfdcfox. Once, the flag has been set for each qualifying record, would the process (email send) run simultaneously on each record? Apr 23, 2020 at 20:58
  • @user2382031 Yes, they're all processed at the same time.
    – sfdcfox
    Apr 23, 2020 at 20:59
  • thanks again. I will give it a go :-) Apr 23, 2020 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .