Muhammad Shams-ul-Arifen (Group
Leader)
Ghulam Mohayyudin (Speaker)
Agenda
• Lightning flows overview
• Types of flows
• Lightning flows roadmap
• Flows vs Apex
• Demo
• Q & A
What is Salesforce Flows ?
● A Salesforce Flow is an automation that collects data and performs
actions in your Salesforce org or an external system
● Flow can fetch, delete, update and create records on multiple objects
● Declarative development tool
Types of Lightning Flows
There are two types of Lightning flows:
● Screen flow
○ can be used to automate a business process that collects data from people. For example,
a guided tutorial or wizard with screens
● Auto Launched Flow
○ can be used to launch a flow internally when a record changes or when a user clicks a
button. For example, perform an action to a record when a user updates or creates a
record.
Types of Lightning Flows
Types of Auto-Launched Flows
● Record-Triggered Flow
○ are tied to an object. Whenever a record from that object changes, the flow kicks in and
allows you to make before-save changes to that record. This type of flow only supports
Assignment, Decision, Get Records, and Loop Elements.
● Scheduled Flow
○ These auto-launched flows launch at a specified time and frequency for each record in a
batch, and they run in the background
● Platform Event Flow
○ run when a Platform Event message is received.
Features Included In Flows
• User Interface
Element Screens
• Logic Elements
• Decision
• Assignment
• Loop
• DML Operations
• Email Alerts
• Quick Actions
• Apex Actions
• DML Operations
(Data)
• Create Record
• Update Record
• Get Record
• Delete Record
● In a flow, a variable is a container that holds a piece of information.
● In a screen flow, store the ID of the record that the flow is displayed on, so
you can tell the flow which record to update at the end of the flow.
● Store a number value
Flow Variables
● Plan out your flow before you start building
● Build your flows in a test environment—like a sandbox or Developer
Edition org.
● Never hard-code Salesforce IDs.
● Wait until the end of the flow to make changes to the database.
● Control when running users can navigate backward.
● Provide an error handler.
● Save early and often.
● Avoid accessing external objects after DML operations in a transaction.
Flows Best Practices
● No DML Statement in Loops.
● Document your flows
● Build Reusable Flows and Sub-flows
Flows Best Practices (Continued..)
● Apex code requires constant development and discipline to maintain.
Flows require less work to keep up-to-date.
● Flows can be built by admins, while Apex code is typically built by
developers only.
● Apex code is considered a tool of last resort. Flows are simpler and should
be used before Apex code.
● If the logic is too complex, Apex code should be used. There is unlimited
potential with Apex; flow capabilities are catching up, but they are still
inferior to Apex.
Flow vs Apex
● You’re dealing with complex Salesforce automation that requires multiple
steps and actions where a flow will become cumbersome.
● You need custom-built integrations with other systems
● If a trigger is already in place.
When APEX code should be used instead of
flows in the following scenarios
General Flow Limits
● Go with Action element
● Call the @invovable annotated method of any apex.
How to call APEX from a Flow
● Flow Builder is the declarative interface used to build individual flows
Let’s meet with flow builder
Demo
Questions?
Getting_Started_with_Salesforce_Flow_for_Developers_(In-person_event)_.pptx

Getting_Started_with_Salesforce_Flow_for_Developers_(In-person_event)_.pptx

  • 2.
  • 3.
    Agenda • Lightning flowsoverview • Types of flows • Lightning flows roadmap • Flows vs Apex • Demo • Q & A
  • 4.
    What is SalesforceFlows ? ● A Salesforce Flow is an automation that collects data and performs actions in your Salesforce org or an external system ● Flow can fetch, delete, update and create records on multiple objects ● Declarative development tool
  • 5.
    Types of LightningFlows There are two types of Lightning flows: ● Screen flow ○ can be used to automate a business process that collects data from people. For example, a guided tutorial or wizard with screens ● Auto Launched Flow ○ can be used to launch a flow internally when a record changes or when a user clicks a button. For example, perform an action to a record when a user updates or creates a record.
  • 6.
  • 7.
    Types of Auto-LaunchedFlows ● Record-Triggered Flow ○ are tied to an object. Whenever a record from that object changes, the flow kicks in and allows you to make before-save changes to that record. This type of flow only supports Assignment, Decision, Get Records, and Loop Elements. ● Scheduled Flow ○ These auto-launched flows launch at a specified time and frequency for each record in a batch, and they run in the background ● Platform Event Flow ○ run when a Platform Event message is received.
  • 8.
    Features Included InFlows • User Interface Element Screens • Logic Elements • Decision • Assignment • Loop • DML Operations • Email Alerts • Quick Actions • Apex Actions • DML Operations (Data) • Create Record • Update Record • Get Record • Delete Record
  • 9.
    ● In aflow, a variable is a container that holds a piece of information. ● In a screen flow, store the ID of the record that the flow is displayed on, so you can tell the flow which record to update at the end of the flow. ● Store a number value Flow Variables
  • 10.
    ● Plan outyour flow before you start building ● Build your flows in a test environment—like a sandbox or Developer Edition org. ● Never hard-code Salesforce IDs. ● Wait until the end of the flow to make changes to the database. ● Control when running users can navigate backward. ● Provide an error handler. ● Save early and often. ● Avoid accessing external objects after DML operations in a transaction. Flows Best Practices
  • 11.
    ● No DMLStatement in Loops. ● Document your flows ● Build Reusable Flows and Sub-flows Flows Best Practices (Continued..)
  • 12.
    ● Apex coderequires constant development and discipline to maintain. Flows require less work to keep up-to-date. ● Flows can be built by admins, while Apex code is typically built by developers only. ● Apex code is considered a tool of last resort. Flows are simpler and should be used before Apex code. ● If the logic is too complex, Apex code should be used. There is unlimited potential with Apex; flow capabilities are catching up, but they are still inferior to Apex. Flow vs Apex
  • 13.
    ● You’re dealingwith complex Salesforce automation that requires multiple steps and actions where a flow will become cumbersome. ● You need custom-built integrations with other systems ● If a trigger is already in place. When APEX code should be used instead of flows in the following scenarios
  • 15.
  • 16.
    ● Go withAction element ● Call the @invovable annotated method of any apex. How to call APEX from a Flow
  • 17.
    ● Flow Builderis the declarative interface used to build individual flows Let’s meet with flow builder
  • 18.
  • 19.