#Trailhead #Salesforce Admin #Flows
Suppose a business requires the Account's Customer Status to update automatically whenever a related Opportunity is marked as Closed Won. How would you implement this requirement using Salesforce Flow? Which Flow type would you choose, and why?
답변 2개
Hi @Pranay yerragunta I would recommend using an After-Save Record-Triggered Flow because we need to update a related Account record.
Implementation Steps:
- Go to Setup → Flows → New Flow → Record-Triggered Flow.
- Select Opportunity as the object.
- Set the condition: Stage = Closed Won.
- Choose Only when a record is updated to meet the condition requirements.
- Select After Save (Actions and Related Records).
- Add an Update Records element to update the related Account using $Record.AccountId.
- Set Customer Status = Active Customer (or the required business value).
- Save, Activate, and Test the Flow.
Why After-Save Flow?
- Before-Save Flow is mainly used to update fields on the triggering record.
- After-Save Flow supports updating related records.
- No Apex code is required for this straightforward requirement.
Best Practice: Test with multiple Opportunities and confirm the Account status updates correctly when an Opportunity changes to Closed Won.