Skip to main content

Flows Calling Flows

The true power of Flow comes from learning how to compartmentalize your logic into specific, reusable Flows that can be used throughout your implementation. I'll cover the basics of how to do this as well as a few other techniques in this post.

Continuing on from the Launch a Flow From Process Builder or Visualforce post...

Last time we made a flow that counts 1 type of Beer and puts that count on the Brewery record. Let's transform that into a reusable flow so we can count all types of beer at the same time! We'll do this by making a master flow that calls our new and improved flow many times.

I'll also be showing a technique that will help you to prevent updating records that do not need to be updated. It's important to prevent Salesforce Automation from snowballing - ie. Process Builder fires a Flow to update a record which then triggers a Workflow Rule to update another field which then fires a Trigger to then... Yeah, you get it. It's messy. And very difficult to troubleshoot when errors occur in the future.

Before Starting the Video

Here's a link to an unmanaged package that contains of all the config I'll be using including the Process Builder, Flows and Visualforce Page. Feel free to install it in a Dev Org and follow along: Flows Calling Flows Config

Here's the Master Flow we ended up with

Here's the Visualforce Page we ended up with


Popular posts from this blog

Joins in SOQL

If you are familiar with SQL, the biggest gotcha when writing SOQL is how joins are done. You'll see the term  Sub-Query  used instead of  JOIN  because of how queries are done on the Salesforce platform. You can still do joins; it's just done a little differently than you're used to. Sub-Query (Outer Join) In SQL, a join is when rows are selected from multiple tables and joined together on common columns. Thinking about your tables like a Venn Diagram is a great analogy for this. Let's say you want to query all Accounts and also include their related Opportunities. This is an example of an Outer Join because it selects all Accounts and will include their related Opportunities via the sub-query. If an Account does not have an Opportunity, it will still be returned here. An Outer Join is similar to selecting one whole circle in a Venn Diagram, including the area that overlaps with the other circle. Sub-Query (Inner Join) An inner join can seem a little m

Salesforce Lighting Migration: Plan for Success

In April 2018, I led the Salesforce Lightning Migration at Postmates . This is how I would do it over again if I could. Define Goals The goals of a Lightning Migration are: Enable Lightning Experience Configure Lightning Experience Document all Salesforce processes Create training and support materials Lightning Experience is adopted Easy enough right? Let's go though the plan to see how we accomplish each one. Enable Lightning Experience Just turn it on right? Well, kinda. Although it may be controversial, I recommend turning it on and hiding the option from all users. This can be done by removing the Lightning Experience User permission from your custom profiles.  And yes, turn it on in production .  Why? You're going to turn it on anyway. Salesforce has declared this as the path forward, so you either turn it on now or wait until they flip the switch for you. Plus, turning this on ahead of time will make deploying from a sandbox much  e

Modify Salesforce Data from the Command Line

When doing Salesforce data loads, how often are you putting the same value in an entire column? I find this happening when I need to: Move all accounts from one user to another Assign a set of leads to a specific user Set a field to a specific value Let's use the example from my other post: Salesforce Data Loads from the Command Line - Move all accounts owned by one user to another user. Magic Let's break down each piece of this: soql This is an alias I set for sfdx force:data:soql:query --query . It saves me from having to type this out each time and let's me query from the command line by just typing soql  and my query. This is a popular StackExchange post  that talks about how to set an alias. cat This command outputs the contents of a file. It is common to use this command with other commands by piping the output into another command. In our example, we are piping the output into the cut command. This post gives more examples of how to use t