Search code examples
javascriptdynamics-crm-2011xrm

How can I add script to Dynamics Crm main.aspx page?


I try to disable specific user login using javascript. If the user tries to login, I will close the window. I saw some examples about adding scripts to main.aspx page but it did not work.

Please help.


Solution

  • I solved it. I added

    <script>
    
    this.onload=function(){
    if(USER_GUID.indexOf("{D9D73FD0-F377-E511-85D2-000C29458CDD}") > -1)
    {
     window.location.replace(null);
    }
    }   
    </script>
    

    before the closing body tag in main.aspx