accessing the logged in CRM user from custom page
问题 We have Dynamics CRM and a webform which is loaded from the ribbon, essentially inside an iframe. How do we get the logged on user? On the top right, is my name and image as logged in via Active Directory. However, if I do something like: var UserID = window.parent.Xrm.Page.context.getUserId(); or in C#: UserPrincipal user = UserPrincipal.Current; lblUser.Text = user.SamAccountName; then we get the generic user that CRM is configured to use. If I do a right click on the entire form and go