function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
johnc82johnc82 

Redirect after login

I'm pretty certain this isn't possible within Salesforce.com, but I need to verify.  Is it possible to have a user redirected based on profile, or even placing a url on the users record so that they are redirected there after logging in to Salesforce?

 

For example, I want them to go right to a queue after logging in.  I can take that url and bookmark it and after logging in, it will take me to that queue view.  Can I place a text field on the user record and put the URL to redirect after login? Anyone know of a way to do this?

bob_buzzardbob_buzzard

The problem you will hit is that you can't intercept any part of the login process, you can only try to take action once the user lands on a page, and you can't guarantee that the user will land on a page that you can influence.

 

For example, you can put some javascript on the home page or in the sidebar, but if the user has bookmarked a dashboard (for example), the home page component and sidebar aren't rendered and thus the javascript can't execute.

 

sfdcfoxsfdcfox

As Bob said, not 100% possible, since you can't guarantee the page they'll land on. You can influence their default login page by setting a page as the default (Setup > Create > Apps > Edit), which gives them a default page to land on when they switch to the app or login (so you could set it to cases, for example). Taking that a step further, you could create a Visualforce page (and corresponding tab) that takes them to ANY page you can imagine when they log in. This will only work if startURL is not specified (which would occur if they used login.salesforce.com, but not if they started from a bookmark or the login page shown after a user's session expires). So, you can heavily influence where they land, but any user that regularly uses bookmarks or lets their session expire without logging out probably won't benefit from your attempts.