Salesforce has many tools that help Admins and managers enforce company policies, processes, and procedures in the application. One of those tools is Login Hours. Login Hours stipulate when users can log in to the specified Salesforce org and are based on the user’s profile and settings.
An example of when this may be helpful is if a company has a very strict end-of-day time to control overtime hours.
Let’s review how Login Hours are set for profiles, with a follow-along example below!
Note: To follow along with the steps below, use or create a Playground from Salesforce Trailhead or a Developer Edition org.
Login Hours Example
- Once you’re in your Salesforce org, click the gear icon in the top, right corner to open the Setup menu.
- In the Quick Find search box, search for “Profiles” and click to open the selection.
- Click the applicable Profile Name to update the profile settings and establish the Login Hours. (Note: In my screenshots below, I’m using a custom profile example that I’ve created in my developer edition org, so you will not have this same profile.)
- In the System section, click on Login Hours.
- Click Edit to specify the Login Hours for the selected profile.
- Take note of the time zone above the Login Hours table. This time zone is populated from the Default Time Zone in the Company Information section of the Setup menu.
- In this example, the Default Time Zone for my org is EDT. However, my users for this profile are located in the PDT time zone (-3 hours), and the working hours we need to enforce for them are 8am PDT – 5pm PDT, Monday through Friday.
- As a result, I’ll set my EDT Start Time and End Times accordingly (+3 hours from the required PDT times.)
- Click Save.
Now, users with this profile will not be able to log in outside of the specified Login Hours.
Time Zone Display and User Details
Above, something interesting happens when we click save on the Login Hours. Although the time zone displayed on the Login Hours page was in EDT due to the company settings, when we click save, the table now displays in PDT.
This is because the Time Zone that’s selected in my personal User Details is PDT. Therefore, after I save the Login Hours, Salesforce makes my view easier by displaying the Time Zone information based on my personal settings.
What happens at 5:01pm PDT?
An important question posed by Mike Wheeler in his Udemy Salesforce Administrator Certification Course is, “What happens at 5:01pm?”
In other words, let’s say a user’s profile has Login Hours with an End Time of 5:00pm. If that user logs into the Salesforce org just before the End Time (say at 4:55pm), what happens when their Login Hour restrictions take effect at 5:01pm?
At 5:01pm, the user can still view the page they’re on in read-only mode. However, they can longer edit anything. If they try to make updates on the page, or if they navigate away from the page they’re currently viewing, they will forcibly be logged out of Salesforce.
To learn more about Salesforce, check out some of my other blogs below!
Additional Resources
- Trailhead by Salesforce: Restrict Login Hours and IP Ranges unit
- Salesforce Help: View and Edit Login Hours in the Original Profile User Interface
- Schema Builder pt. 1: What is it?
- 11 Salesforce Certification Study Tips
Cover Photo by Sonja Langford on Unsplash