Find currently logged on user in ms crm 4.0

Answered Find currently logged on user in ms crm 4.0

  • Thursday, January 24, 2008 12:46 PM
     
     

     

    Hi,

     

    We are working on MS CRM 4.0 (RTM). 

     

    We have a requirement, wherein on click of a custom button (created through ISV.CONFIG), I need to find the currently logged in user's userid and pass it as a querystring to one of the URL.

     

    I tried the following Javascript code, but it throws an error...

     

    //make a who am i request
    var whoAmIRequest = new RemoteCommand("SystemUser", "WhoAmI", "/MSCRMServices/");
    //execute the command and obtain a response
    var response = command.Execute();
    //get the user id from the response xml
    var userIdString = response.Xml.text;

    alert(userIdString);

     

    any help in this regard is very helpful and greatly appreciated.

     

    Thanks!!!

All Replies