Lightning Flows in Salesforce: How to Call Auto Launched Flow from Process Builder in Salesforce ?

Under this topic, we will check:

  1. How we can create an auto launched flows in Salesforce.
  2. How to call an auto launched flow from process builders.
  3. How can we pass paramters from process builders to lightning flows.

Problem Statement:

When ‘Customer Priority’ field on Account is updated, update the ‘Priority’ field of all related cases having ‘Status’ as ‘New’ with same values.

Please check below video for detailed explaination along with examples and demo.

If you have any questions related to this topic, please add them in comments section of the video.

Advertisement

Lightning Flows in Salesforce: Using Formulas in Salesforce Lightning Flows

Under this topic, we will discuss, how we can use formulas in Lightnng Flows in Salesforce.

For using formulas, we need to create a resource of formula type and than use it in our flows.

If you want to know detailed explaination on how to create and use formulas in lightning flows, please check below video:

If you have any questions related to this topic, please add them in comments section of the video.

Lightning Flows in Salesforce: Record Choice Set in Lightning Flows

Under this topic, we discuss how we can use a record choice set to create an input field corresponding to Lookup fields in salesforce.

This is helpful when we have to use lookup fields in screen flows in salesforce.

While creating record choice set, you can even apply filter conditions to bring only specific lookup records , so that only those would be available for users to select. You can even sort records while fetching or configure those choice’s labels.

If you want to know the detailed explaination along with examples and demo for creating record choice set in Lightning Flows in Salesforce, please check below video:

If you have any questions related to this topic, please add them in comments section of the video.

Lightning Flows in Salesforce: Creating Picklist Choice Sets in Lightning Flows

To use picklist fields inside lightning flows,we need to have the picklist values available.

For this, we need to create a picklist choice set from resources section in flows.

Then, we can use those picklist choice set inside Screen Flows and map with picklist fields.

If you want to know the detailed explaination along with examples and demo for creating picklist choice set in Lightning Flows in Salesforce, please check below video:

If you have any questions related to this topic, please add them in comments section of the video.

Adding Lighting Flows to Record Pages

Under this topic we will see, how we can create variables and use them in lightning flows.

We will also see how to include our Lightning Flows inside records pages in Salesforce.

To incldue a flow on lightning record page of an object, we just have to edit the page with the help of lightning app builder and include flow in it.

We can pass the current record Id as parameter to Flow. We just have to create a variable in flow from resources section and make it available for input, then pass the value from record page itself.

If you want to look into detailed explaination with the help of example, Please check below video:

Let me know in the comments section of video, if you have any doubts related to this topic.

Creating First Flow with Screen Element and Debug a Flow

Under this topic we will look into:

Create a contact Records with the help of Screen flows

How to Debug a Flow.

Please check below video for detailed explaination on creating a Flow with Screen Element and how to debug a flow:

Let me know in the comment section of video, if you have any doubts.

Introduction in Lightning Flows in Salesforce

What is Flow Builder ?

Lightning Flow is the product inside salesforce to automate complex business processes.

Lightning Flow provides two tools Process Builder and Flow Builder.

Process Buidler is used to create processes.

Flow Buidler is used to create Flows.

When to use Flows?

If you want to automate a guided visual experience.

If you want to build more complex functionality as comapared to process buidler.

If your team does not have enough developers, flows could be alternative to write an apex code. Time and efforts to write a flow is much lesser than apex code.

Advantages of Flows

Flow builder provides a visual debugging interface whic makes troubleshooting smoother.

If you are delivering for a client team, flows are easier to maintain by providing an interface for admins to make changes easier in longer term.

If your team does not have enough developers, flows could be alternative to write an apex code. Time and efforts to write a flow is much lesser than apex code.

Flows interviews automatically bulkify the actions.

Flow Elements:

User Interface:

Screen Elements

Action

Subflows

Logic Elements:

Assignment

Decision

Loop

Pause

Data Elements:

Create Records

Update Records

Get Records

Delete Records

Resources in Flow Buidler

Variables

Constants

Formula

Text Template

Choice

Record Choice Sets

Picklist Choice sets

Stage

Lets look in to below video to actually go into flow builder and explore these things:

Let me know incase of any doubts or questions in comments section of video.

Publish/Subscribe a Platform Event Using Apex Code and Apex Triggers

Publish a Platform Event Using Apex Code

To publish event messages, you create an instance of the event and pass it to the EventBus.publish() method.

Subscribe a Platform Event Using Apex Trigger

You simply write an after insert Apex trigger on the event object to subscribe to incoming events. Triggers provide an autosubscription mechanism in Apex.

Platform events support only after insert triggers. After an event message is published, the after insert trigger is fired.

Problem Statement

When an Account is updated with Customer Priority Field as high, update the priority field related case records with same value. However, the last modified by of those updated case record should not be the one who modified the account record.

Important Notes

Order of Event Processing

A trigger processes platform event notifications sequentially in the order they’re received. The order of events is based on the event replay ID.

Asynchronous Trigger Execution

A platform event trigger runs in its own process asynchronously and isn’t part of the transaction that published the event.

There might be a delay between when an event is published and when the trigger processes the event.

Automated Process System User

Platform event triggers don’t run under the user who executes them (the running user) but under the Automated Process system user

Please refer below video for detailed explainaion with example :

Subscribe to Platform Event Using Process Builder

We can Subscribe a platform event using:

Process Builder

Flows

Apex Triggers

Lightning Web Component

Aura Component

External App Using CometD

Problem Statement

Whenever an Deadline field on  account is updated, Deadline field on all related cases should be updated with same value.

Please refer below video for detailed explaination: