Posts

Salesforce Lightning Flow Redirect

By April 1, 2020 July 11th, 2020 No Comments

Salesforce Lightning
Flow Redirect

Salesforce admins can customize the look and feel of their salesforce experience with flow builder. Here are guided steps to help build interactive custom components without any code

Redirect the flow to the Current Record.

Adding lighting component into Flow.

Adding Flow into Action Button and Home page.

To use all above-mentioned features we need a solid scenario. So I have created a sample flow which is useful for creating Quick contact from anywhere in the org, finally redirect to the actual contact.

Following 4 Screenshots will explain how to create a sample flow with the

Create a Screen Flow with Screen and Create Record Component.

Add Following Fields into the Screen Component

Lookup field (Account)

First Name

Last Name

Mobile Number

On the Create Record Component select values shown below.

Map the Account Values to Captured values from the flow.

How to Redirect from flow to currently created record.

There is no standard feature to redirect from flow to record page(created by this flow). So we have to write a simple Lighting Component(Aura). This is a very simple component specially no Apex coding required and no test classes at all. I have shared the code in below, Please copy and paste appropriate places. Get into the Developer console then
NEW→ Lightning Component

Choose any name and select all checkboxes as shown below as we are going to use this component in multiple places.

On NewFlow.cmp use the following code



On NewFlowController.js use the following code ({ init : function(component, event, helper) { var navEvt = $A.get(“e.force:navigateToSObject”); navEvt.setParams({ “recordId”: component.get(“v.recId”), }); navEvt.fire(); } })

On NewFlow.design use the following code

Save all files, Now the component is ready to use in our flow. Let’s get back to the flow which we have created earlier. Select a Screen flow to pull our Lighting Component(New Flow)

Search(Left Side) the NewFlow which will come under Custom, Pull the New Flow on the Screen.

Create a Text Variable and Place on Id of the record which we defined on NewFlow.design

Open the Create Record Screen again

Scroll down up to the end,
Select Manually assign Variables(advanced)
Place the ID of the Record on the Store Contact ID in Variable.

Now the flow is ready to use as we expected. Now we can use this flow in multiple ways, I am going to show the following 2 ways.

Action Button

Lightning Pages(Home)

Go to Buttons, Links, and Action→ Create New Action

Select the Flow which we have created now(Quick Contact)

Pull the Action Button into the Page layout where you want to use.

Now the Flow is ready to use on the record page

Otherwise, we can add this flow into Home Page also
Go to the Home Page → Edit Page

Drag the Flow as shown direction in below and select the Quick Contact flow on the right side

Now the Flow is ready to use on the Lighting Page(Home Page)

Sample Contact Creation or Test our flow how it is working, the Flow will react the same way in any pages. Full fill the following fields

Once you submit the values the flow redirected to the newly created record.

Hope this will help you Trailblazers

Check out our other blogs

Learn more: Flow builder

Recent Posts

Top salesforce youtube channelsPosts
July 17, 2020

Top Helpful Youtube Channels to get you started with Salesforce

Salesforce skills can help advance careers for beginners or for anyone who wants to get in the Salesforce ecosystem. Job seekers can find high-demand, high-paying and high-growth jobs
Case Study
July 8, 2020

Partner Community Portal Enhancement

Case Study Partner Community Portal Enhancement Client / Industry: Business Events Sydney Timeframe: June 2018 – April 2019 Area of expertise: Software engineering and Development Responsible for Techforce Services worked…
Case Study
July 8, 2020

Salesforce Data Management & Analysis

Case Study Salesforce Data Management & Analysis Client / Industry: Rehau / Manufacturing Timeframe: June 2018 - ongoing Area of expertise: Training, Learning and Development Responsible for Techforce Services worked…

Leave a Reply