Salesforce Data Security and Access – Part 4 (Login Hours)

HELLO Salesforce Thinkers, In our previous blog we learned about Salesforce Data Security and Access – Part 3 (Login IP Ranges and Trusted IP Ranges) In this blog we are going to learn about “Login Hours”. We will continue our learning journey by a series of blogs to go deeper and understand the Salesforce Data Security Model, Visibility and Access.

Login Hours :

With the help of Login hours we can specify the hours when users can log in to the organization based on the user profile.

If a user tries to login outside of these hours, they are denied access. when a user is denied access, they see the same error message which appears when the username or password is incorrect.

User permission Needed : Manage Profiles and Permission Sets

Example :

If we have a requirement in that we want some users should only be able to log in during the company’s standard office hours and all other users should have 24/7 access. To fulfill these type of requirements we can set login hours at profile level.

Restrict Login Hours on user Profile:


Setup >> Enter Profiles in the quick find box >> and select Profiles.

Select any profile, In this case we will define login hours for Custom “Service Profile”.

Select Login Hours.

click Edit and set up the schedule.

Click Save.

Depending on whether we’re viewing or editing login hours, the hours appear differently. On the profile detail page, hours appear in our specified time zone.

On the Login Hours edit page, the hours appear in the org’s default time zone.

To allow users to log in at any time, ‘Clear all times’ can be clicked.

To prohibit users from logging in on a specific day, set ‘Start Time’ to 12 AM and end time to End of the day.


 The first time login hours are set for a profile, the hours are based on the org’s default time zone as specified on the Company Information page in Setup.

After that, changes to the org’s default time zone on the Company Information page don’t affect the time zone for the profile’s login hours. The profile login hours remain the same, even when a user is in a different time zone or the org’s default time zone changes.

What happen if a user logged in when their login hours end?

If users are logged in when their login hours end, they can continue to view their current page, but they can’t take any further action.

Let’s take an example:

Question : If a users profile can login from 4 pm to 5 pm and a user logs in at 4.30 pm then what happens at 5:01 pm?

Solution : The user will remain logged in but can’t do anything. User will be able to navigate to the pages, but won’t be able to perform any action, like Create a record, update delete, insert. But user will be in read only mode.

Thank you for reading this blog, Hope it is helpful.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s