About

all about SFDC

Sunday 2 June 2019

Navigate users to record detail after finishing Screen Flow

23:37

This blog post demonstrates how to navigate a user to record detail automatically after finishing the flow. This can be achieved with a a custom Lightning Component which can accessible in side the flow. The standard Lightning interfaces force:lightningQuickAction and lightning:availableForFlowActions will make the lightning component is accessible from core actions section in Flow builder.




Let's create a Lightning Component that can be accessible inside the flow and can be accessible for core actions in flow. Create a lightning component as specified below. The invoke method in the controller js will be fired automatically when flow invokes the lightning component.





Let's create flow now, To avoid complexity let's consider a basic contact insertion with a screen flow. 


A new contact screen in flow builder. Let's build a form with flow builder with contact first name, last name. mobile and phone. First Drag and drop a screen component from flow builder and add all text components for above mentioned fields in new contact form.




In the next step, drag and drop the create records action from flow builder and select contact object for insertion and also map all the text fields values(no flow variables required) from previous screen flow to contact object fields in current screen. Also create a variable to hold record Id of contact after insertion as in below screenshot {!contactId}. While creating this variable make sure you did not provided any default value for variable and avoid "Available for input" option in flow variable screen or else flow will throws an error.





In the final step, drag and drop the Core Actions action from flow builder and choose the lightning component that we created initially and provide mapping for record Id in the Lightning component from the flow variable contactId which consists a inserted contact Id.  


We can preview this screen flow from app builder. Just go to app builder from Lightning Quick find side bar in setup and create an App Page from app builder and drag and drop your screen flow. Once created an app page we can access it from app launcher search bar.

3 Comments

Note: only a member of this blog may post a comment.

Powered by Blogger.

Contact form

Name

Email *

Message *

Visualforce

Apex

Lightening UI

Translate

Comments