Flows 3. Flows - Chirag-ahir/SFC-Preparation GitHub Wiki
Flows are powerful tools for automating business processes, collecting data, and guiding users through various tasks. Flows support a wide range of operations to manipulate data and execute actions. Some of the key operations supported in Flows include:
Record Creation: Flows can create new records in Salesforce objects like Leads, Contacts, Accounts, Opportunities, etc.
Record Updates: Flows can update existing records in Salesforce objects, allowing you to modify field values based on certain criteria.
Record Deletion: Flows can delete records from Salesforce objects, though this operation should be used with caution due to its irreversible nature.
Record Lookup: Flows can retrieve records from Salesforce objects based on specified criteria, allowing you to work with existing data.
Screen Elements: Flows can display screens to users, collecting input through various elements like text fields, picklists, checkboxes, etc.
Conditional Logic: Flows support conditional logic, allowing you to make decisions based on the values of variables, user input, or other criteria.
Subflows: Flows can call other flows (subflows), allowing you to modularize your processes and reuse common functionality.
Apex Actions: Flows can call Apex code to perform complex calculations or execute custom business logic.
Email Alerts: Flows can trigger email alerts to notify users or stakeholders about specific events or conditions.
Approval Processes: Flows can initiate approval processes, allowing you to automate the approval/rejection of records based on predefined criteria.
Database Operations: Flows can perform various database operations like querying records, inserting records, updating records, etc.
What is mean by bulkify a flow? To bulkify a Flow means to design and optimize it to efficiently handle and process multiple records at once without hitting Salesforce's governor limits.
We have six different types of flows in salesforce.
STEP1: Select a object in which you want to create a flow.
STEP2: Set the entry criteria: (When to trigger a flow)
STEP3: Set Entry Conditions
Flows are able to create, edit, and delete records in Salesforce, send emails, show relevant data and gather input from users, and generate outbound messages
Screen Flow:
Screen Flows are a type of Flow in Salesforce that allows you to create guided, interactive processes for your users. Screen Flows are used to collect data from users through a series of screens. They can be triggered manually by users, embedded on record pages, or accessed through Lightning pages, apps, or components. Screen Flows are particularly useful for creating complex forms, multi-step wizards, or any interactive user process.
Ex. you can create a user-friendly Screen Flow that simplifies the case creation process for support agents, ensuring that all necessary information is collected and recorded accurately.
Record-Triggered Flow:
Record-Triggered Flows in Salesforce are automated processes that are initiated when a record is created, updated, or deleted. These flows allow you to automate complex business processes without needing to write Apex code. They are part of Salesforce Flow, a powerful tool for implementing business logic.
Ex. we can create a record-triggered flow to post closed case details to Chatter group whenever a Case's stage is changed to Closed.
Simplified Steps:
- Create a new Record-Triggered Flow for Case.
- Set the trigger to A record is updated.
- Add a condition: Stage equals Closed.
- Choose to run the flow Only when a record is updated to meet the condition requirements.
- Add Chatter Action:
- Add a new Action element.
- Select Post to Chatter.
- Configure the post with:
- Post To: This Record's Chatter Feed
- Message: "The Case {![Case].CaseNumber} has been closed. Please check for further details."
- Save and Activate:
Schedule-Triggered Flow
A Schedule-Triggered Flow in Salesforce is a type of flow that runs automatically at specified intervals. It is a powerful automation tool within Salesforce that allows users to schedule certain actions to occur at specific times without manual intervention. This can be particularly useful for tasks that need to be repeated regularly or actions that should be taken at a set time.
Ex. we can create a schedule-triggered flow which ensures that opportunities that have been kept in the "Negotiation" stage for more than 30 days are automatically updated to "Closed - Lost," helping sales teams keep their pipeline data current and actionable. This schedule triggered flow will run everyday at 12:00 AM