Thursday, April 6, 2017

Login Flows to Display Important Messages to User After Login

Sometimes it is required to display some message to SFDC users when some maintenance or migration activity is getting performed in production. For example, during some major project release which may take many hours or many days for metadata and data migration, you want to display message to SFDC user saying "Maintenance is in progress and you may experience intermittent issues".

You might have seen these kind of intermediate screen informing about Salesforce maintenance window after logging into salesforce.

Login Flows allow administrators to display intermediate screen (Flow) once user is authenticated and after that user will be redirected to home page of salesforce.

You can create a flow using flow designer and associate it with Login flow. As you already know that flow can be used to collect some information from users or to display some message to end users. Using flow you can specify set of screen to capture data from user or navigate the user's to set of instructions.

Important points regarding Login Flows:
  • The login flow screens are embedded within the standard Salesforce login page for uniform user experience.
  • You need to associate Login flows to different profiles. So all user related to that profile will see flow screen after authentication.
  • Login Flows can be applied to SFDC Orgs, communities and portals. 
  • 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

Now we will create a sample flow to display maintenance message to end users during some major project release. Below are steps which we need to follow:


Create a flow

  • Navigate to Set Up--> Create-->Flow. Click on New Flow button. This will open Flow designer screen. Drag Screen Palette from left side and name it as "Maintenance Window Message".

  • Now Click on "Add a Field" tab and double click on display text.

  • Now click on "Field Settings" tab and click on display text. Give unique name as "MessageToDisplay". Specify the message which you want to display to end User and then click Ok.

  • Mark screen as start element for you flow by clicking on green down arrow as shown below.

  • Now Save flow by clicking on Save button and name flow as "Maintenance Window Flow".

  • Now Close the Flow and Activate it. Click on Activate link. Remember only active flow will be available for login Flows.

Assign Login Flow to Profile

  • Navigate to Set Up-->Security Controls-->Login Flows. Click on New Button. Specify name as "Maintenance Window Message" and select license and profile. Profile list depends on license selected by user.

  • In this way you can create multiple entries for different profiles.

Now you login into Salesforce to test this. Once you specify your username and password, you will see below message screen.



Points to remember:
  • You can just delete the login Flows records after maintenance window so that users will not see this message after login.
  • You can not create more than 1 login flow record for a given profile. Suppose you want to assign different flow to same profile in login flow then you will get below error:



Hope this will help!!!

For more details on Login flow, please refer below URL:
Login Flows


Other Blogs>>: 
DYNAMIC APEX IN SALESFORCE
SOQL INJECTION IN SOQL
CUSTOM METADATA AND CUSTOM SETTINGS IMPLEMENTATION TRICKS
REST API TUTORIAL FOR SALESFORCE
VISUALFORCE COMPONENT FOR RECORD STATUS BAR
FETCHING FILE FROM EXTERNAL/PUBLIC URL AND STORING IT IN SALESFORCE

7 comments:

  1. Will this work for community login as well?

    ReplyDelete
  2. Yes. This will work for communities.
    You need to create entry in login flows for profile which is assigned to community.

    ReplyDelete
  3. This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
    Sales Fore CRM Training in Chennai

    ReplyDelete
  4. Krishna ChimakurthyOctober 12, 2017 at 11:04 PM

    hi Sunil hope you are doing well.If an Org have 200+ profile and we want to put this maintenance message to all the users, how can we avoid creating 200 login flows? is there any global setting that displays across the profiles?

    ReplyDelete
    Replies
    1. Hi Krishna,

      As far as I know, Login flows can be associated with profiles only. I am not aware of any setting which initiates login flow for all users in organization.

      Thanks,
      Sunil Kumar

      Delete
  5. Is it possible to display images/screenshots in a login flow? I can get the images to display if I run the flow manually (via the Run button in the designer window), but when I run it as a login flow, the images don't appear. I have my image uploaded as a Document, to a public folder, and marked as external. The HTML I'm using is (adding without the outside brackets because it won't let me post otherwise)

    img src="/servlet/servlet.ImageServer?id=0152D000000Dxxx&oid="00D2D0000000xxx"/

    ReplyDelete