The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Recommended

Build a win-back review queue for Closed Lost Opportunities with a scheduled Flow (opens in a new tab)

You will learn how to add a loss reason and revisit date to lost Opportunities, have a Scheduled Flow create follow-up Tasks on those dates, and keep lost deals linked to any later win.

Why read this

The approach needs no Apex.

  1. Require a loss reason on Closed Lost
  2. Set Revisit_On__c with a Record-Triggered Flow
  3. Scheduled Flow runs daily on revisit date
  4. Create a Task assigned to the owner
  5. Route inactive owners to a queue or manager
How a Closed Lost Opportunity moves from lost deal to a daily revisit Task

The author argues that Opportunities marked Closed Lost fall out of pipeline reports and are rarely revisited, so lost deals return only by chance. He proposes a declarative setup that turns them into a review queue.

The setup adds two Custom Fields on Opportunity, Loss_Reason__c as a picklist and Revisit_On__c as a date. A Validation Rule requires a loss reason when the stage is Closed Lost. A Record-Triggered Flow sets the revisit date, with a default of 12 months after the close date that can vary by reason.

A Schedule-Triggered Flow runs daily on Opportunities that are Closed Lost and whose revisit date is today. It creates a Task for each record, assigned to the owner, with a subject, the activity date and a description containing the reason and amount. Inactive owners will cause failures, so the author suggests routing those records to a queue or manager with a Decision element. Before activating the flow, he recommends running a SOQL query to preview the next 30 days of revisits.

The author also suggests a lookup field, Original_Opportunity__c, to link a new Opportunity to the lost one when a deal returns. He warns against reopening old records or deleting Closed Lost ones, since that erases the history needed to measure how many lost deals come back and after how long. A second query groups won deals by the loss reason of their original Opportunity to test this.

Read the original at dev.to (opens in a new tab)

Worth reading?

Five timing decisions that determine whether a Scheduled Flow runs reliably (opens in a new tab)

You will know five design choices to settle before activating a Scheduled Flow: run window, repeat-safety, batch sizing, failure handling and run context.

Why read this

The article is a practical checklist rather than new platform information.

  1. Pick a quiet run window
  2. Make repeat runs safe
  3. Size batches for volume
  4. Catch failures loudly
  5. Confirm the run context
The five timing decisions to settle before activating a Scheduled Flow, in order

The author argues that a Scheduled Flow should be designed around timing, since nobody watches it run. The run window should avoid overnight integrations, data loads and backups that might lock the same records, so admins should check scheduled Apex jobs and ask integration owners before choosing a start time.

Because a daily Scheduled Flow re-evaluates its entry criteria on every run, records that still qualify will be processed again. The article recommends a flag field, a date stamp or a processed checkbox so that updates happening once are not repeated, and it treats batch sizing as a deliberate design decision, warning that a Flow tested on fifty records can hit governor limits at fifty thousand.

The piece also covers failure handling, which is quieter than for Record-Triggered Flows, and run context, since Scheduled Flows run in system context by default and bypass Sharing Rules and field-level security. It closes by suggesting a monthly review of every active Scheduled Flow as business rules and fields change.

Read the original at dev.to (opens in a new tab)

Worth reading?