ThomasShelbyLTD
ThomasShelbyLTD

Reputation: 11

Salesforce Flow: Changing Stage field from a specific date (e.g. after 6 months)

I'm new to flow and trying to create an automation that will update the Opportunity Stage from "Prospecting" (any Stage but Closed Won) to "Closed Lost" Stage if more than 6 months has passed from the Close Date field.

Scenario: Today's Date 11/24/2023

Opportunity1: Stage = Prospecting / Close Date = 05/24/2023

Opportunity2: Stage = Qualification / Close Date = 01/24/2023

Opportunity3: Stage = Needs Analysis/ Close Date = 11/23/2023

After Flow automation being applied:

Opportunity1: Stage = Closed Lost / Close Date = 05/24/2023

Opportunity2: Stage = Closed Lost / Close Date = 01/24/2023

Opportunity3: Stage = Needs Analysis/ Close Date = 11/23/2023 (no change; criteria not met)

I have tried creating a Flow but not sure which "Core" if Record-Triggered Flow or Schedule-Triggered Flow. I am very new to this and have only tried in Trailhead. I am more familiar with Process Builder but this feature will be removed soon.

Upvotes: 1

Views: 336

Answers (1)

eyescream
eyescream

Reputation: 19612

I'd go scheduled flow because you have existing data you want to kill. If you'd be building it from scratch on an empty table - record-triggered flow with a "scheduled path" would be pretty similar to what you know from Process Builder as scheduled actions or maybe you even used time-based workflows (rip)

Try https://trailhead.salesforce.com/content/learn/modules/autolaunched-scheduled-flows/schedule-a-flow , https://trailhead.salesforce.com/content/learn/modules/record-triggered-flows/add-a-scheduled-task-to-your-flow if you haven't used them before.

Just be warned that while scheduled flows behave similar to Apex batch jobs - there's no nice way to set the "batch size". If it'll try to mass close 200 opportunities and the side effects will turn out to be too much ("Apex cpu time exceeded" for example) - you'll have to help it by closing backlog of data manually or make it look only at opps created after certain date maybe...

https://ideas.salesforce.com/s/idea/a0B8W00000GdccSUAR/scheduled-flow-batch-size-option

Upvotes: 0

Related Questions