Login Flow : Display Message while User Logs into Salesforce
Sometimes it is needed to show some message to Salesforce users when some maintenance or migrating activity is getting performed in salesforce org. You might have seen intermediate screen informing about Salesforce maintenance window after logging into Salesforce. So, we have one feature known as Login Flow Salesforce, using that we can participate in standard login process of Salesforce.
Let’s explore this using example!
What is Login Flow?
Login flow Salesforce use to display intermediate screen or directs the user through login process before they access the salesforce org.
Client wants to show custom message as a reminder to log hours to salesforce user if he/she has not logged it.
Steps to Implement
We create a custom field called Remind User to Log Time(checkbox) on user object to decide who has logged the hours and who has not.
Now, create new visual flow by navigating to Setup|Workflows & Approvals|Flows|New Flow
Then create variable to store above created checkbox value
Fig. 1.1 Flow Variable
4. Based on checkbox value, if checkbox is true then will display custom message to user while logging to salesforce org. So, for this include Decision element in flow and enter values as mentioned below.
Fig. 1.2 Flow Decision Element
5. Now it’s time to add final component i.e. screen element to display the message.
Fig. 1.3 Display Message
6. Now connect “YES” decision to screen element and your flow will look like this. Now activate your flow.
Fig. 1.4 Flow
7. Yes, we are done with flow. Now it’s time to create Login Flow so for that navigate to Setup| Administration| Security Controls| Login Flows|New
8. Enter name, select recently created visual flow and profile for which it should be enabled.
Fig. 1.5 Login Flow
Points to remember about Login Flow
It is suggested as a best practice not to use Login flow Salesforce for System administrators, if some issue arises, they should be in a position to rectify and resolved it.
Login flow comes into picture whenever user login through UI either using username and password, delegated authentication, SAML single sign-on, and social sign-on through a third-party authentication provider
Login Flows can be applied to Salesforce Orgs, communities and portals.
Other use cases where we can use Login Flow
Restrict login from Internet Explorer Browser.
Collect and update user data. For example, Email address, phone number etc.
Connect the external identity service and collect or verify user details while logging into salesforce org.
Customize the Login experience like adding company logo or login message.
Yayyy…! You are done with it my friend. Hope that it was as much fun for you as it was for me.