15 May, 2023

Salesforce Flows

by Martina Dimitrievska, Salesforce Developer at codeSTREETS

Part 2 of 2

In case you have missed Part 1 of this short blog series on Salesforce Flow, you can find it here.

What's in part 1

    • Introduction to Salesforce Flow

    • Types of Salesforce Flows

    • When to use Salesforce Flow

    • When NOT to use Salesforce Flow

    • How to build a Flow

Difference between Flows and Processes

Users often get confused between flows and processes in Salesforce, using the terms interchangeably. Here are the major differences between the two:

    • Salesforce processes are more user-friendly concerning setup and management than Salesforce flows.

    • Flows allow users to add screens to enter data, while processes do not provide you with this facility.

    • A Salesforce flow can be invoked by users, triggered by a change in the records, or scheduled to run at a specific time and frequency. On the other hand, a Salesforce process runs automatically when the required criteria are met. Users can also invoke a process by creating one using the Process Builder.

    • While Salesforce flows can be paused by users, processes cannot be paused and keep running until the criteria are met.

    • While the actions of Salesforce processes are executed in the order of their appearance in the process definition, flows often have a more complicated order of operations.

    • Salesforce flows can be used for cycling through multiple Salesforce objects (related and unrelated). On the other hand, processes are limited to the base and related Salesforce objects.

    • While processes can be triggered only after a record has been saved, users can design Salesforce flows to be triggered when records are created, updated, or deleted.

Difference between Flows and Apex

Apex code requires a developer and Sandbox to deploy, meaning it can only be built in organizations using a Professional or above edition of Salesforce. Flows can be built in all editions. While a Sandbox is not required to get a flow into a production environment, it is advisable that flows that leverage the full power of the tool are built and tested in a sandbox before being deployed to production.

Apex is unavailable in Essentials, and some Apex features are limited in Professional. Organizations with Enterprise and above have no Apex limitations, but flow features are not limited based on the edition. 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. Each release brings new features that reduce the use cases that require Apex, but there are still some situations where Apex will bring a performance boost and should be considered. Renewal generation, Opportunity Product, and other pieces of automation that were traditionally built as Apex code can now be built as flows, preserving code space for projects that require Apex.

Apex code should be used in the following scenarios:

    • Your flow requirements require nesting loops

    • Your flow requirements require getting elements inside a loop

    • You are working with exceptionally large data volumes

    • You need custom-built integrations with other systems (such as a connection to a SQL database that requires bi-directional syncs)

    • ERP integrations are involved

    • You need to log in or present a custom error message if the automation fails or doesn’t find what it wants (However, you can do this in some cases with Flow!)

Common Mistakes Made When Designing Flows

Here are some common and avoidable mistakes:

    • Using the wrong field or variable

    • Not checking for null values

    • Putting Get, Create, Update, or Delete elements inside of a loop element

    • Referencing objects or fields that an end user may not have access to

    • No access to running flows

    • Using Get elements to get data that is available through the $Record or $RecordPrior in a record or scheduled trigger flow

    • Hardcoding record Ids

Conclusion

Salesforce flows can be a powerful tool when used correctly. It empowers admins to build complex business solutions. The use cases for Flow are endless, and its capabilities are growing with every Salesforce release. These were some of the most basic yet essential aspects to know about Salesforce flows. Whether you're looking to streamline your sales process, improve customer service, or automate other business processes, flows can help you achieve your goals by providing a simple yet intuitive automation solution for your organization.

About codeSTREETS

codeSTREETS is a Registered Partner of Salesforce, with the HQ in Amsterdam, The Netherlands, and the Salesforce Center of Enablement in Skopje, North Macedonia.

If you want more information on how codeSTREETS can support your Salesforce Automation needs, contact us at contact@codeSTREETS.com.

Alternatively, you can read more about the Salesforce Services codeSTREETS delivers on our site.

Share: