locked
how to get the user name in CRM 4.0 with IFD RRS feed

  • Question

  • How to get the user name using C$ in CRM 4.0 WITH IFD. Kindly help
    Wednesday, July 7, 2010 11:09 AM

Answers

  • Hi All,

     

    Well I tried using whoamirequest and other sdk procedures to get the user name but I couldn't do so. I found another process which helped me to achieve my task. below is the process

     

    1) try to get the authenticated user using request server variables

    2)check if it contains guid value or a normal text

    I've done it like this

    string userid = Request.ServerVariables['Auth_User'];

    try

    {

    guid currentUser = new Guid(userid);// it will genearate excpetion when you access in onpremise mode since the user name is not guid

    get the user information from Sytemuser entiry using the currentUser

    use the fetched username

    }

    catch

    {

    use the 'userid' value as the username.

    }

    Monday, July 12, 2010 12:50 PM

All replies

  • Hi,,

     

    You can use same whoamirequest and response to get the loggin user id and through this u can get the user name

     

    thanks

    Kannan B

    Wednesday, July 7, 2010 11:44 AM
  • Thanks for the response. I will try the same and let you know the feedback
    Thursday, July 8, 2010 5:41 AM
  • Hi All,

     

    Well I tried using whoamirequest and other sdk procedures to get the user name but I couldn't do so. I found another process which helped me to achieve my task. below is the process

     

    1) try to get the authenticated user using request server variables

    2)check if it contains guid value or a normal text

    I've done it like this

    string userid = Request.ServerVariables['Auth_User'];

    try

    {

    guid currentUser = new Guid(userid);// it will genearate excpetion when you access in onpremise mode since the user name is not guid

    get the user information from Sytemuser entiry using the currentUser

    use the fetched username

    }

    catch

    {

    use the 'userid' value as the username.

    }

    Monday, July 12, 2010 12:50 PM