DEACTIVATE USERS NOT LOGGED IN FOR PAST 90 DAYS

Salesforce flow helps the users in automation and makes their work easy. A schedule triggered flow starts at a specified date and time with a specified frequency. So the user does not have to again and again do the thing manually and it saves his time.

If the User has not logged in for the past 90 days, we want to deactivate the User automatically with a note that the user has not logged in for 90 days.

STEPS FOR THIS FLOW

Step 1: Go to setup, search for flow and create a new schedule triggered flow.

Step 2: Enter the start date,start time and frequency as below


Start Date

Step 3: Choose an object and add the conditions the user wants.


Conditions

Step 4: Go to Manager and create new formula resource to calculate 90 days ago


New Formula

Step 5: Drag and drop a decision element and enter the details as below:


Edit Decision

Step 6: Create a custom field in User object and a text formula for Note.


Custom Field

Step 7: Drag and drop an assignment element so that the user can be updated for deactivation


Edit Assignment

Step 8: Drag and drop update records to change the data in User’s org.


Update Records

Step 9: Finally it is done. Now whenever a user has not logged in for the past 90 days he will automatically be deactivated.

Flow


Deactivate User

Summary

Salesforce flows is a tool which helps in automation of complex situations without any line of code. In this use case I have defined how to deactivate users who have not logged in their account for the past 90 days. Users do not have to deactivate manually, scheduled-trigger will automatically do the same and thus saves User’s time. It will also allow the user to add a note and send to the user that he has not logged in for the past 90 days.

The benefit of the feature is that the license can be freed up for other users from users who are not actively using Salesforce.