+ Start a Discussion

Redirect user to VF page on login

For all users of a particular profile, when they login they should be taken to a visualforce page instead of the standard home page. I can differentiate the user based on profile in the controller if I'm able to redirect ALL users to the visualforce page.


Any ideas?


Thanks in advance.



Best Answer chosen by Admin (Salesforce Developers) 

I did something like this. I used a homepage component to redirect. I was checking if it in iPad it will redirect to custom VF page instead of standard one.

May be you can get some idea from this.

Create a home page component and write a similar logic there:

<script type="text/javascript">
        function addLoadEvent(func) {  
            var oldonload = window.onload;       
            if (typeof window.onload != 'function') {   
                window.onload = func;                    
            else {                 
                window.onload = function() {     
                if (oldonload) {                  
        addLoadEvent(function() {         
        <!--------/Wait for the loading of the page--------->
        <script type="text/javascript">         
        function GoToPage() {        
            window.location= '/apex/pageName';