Dynamics 365 JavaScript Get User

Leave a comment

To get the Dynamics 365 user name and user id in JavaScript, create a function and attach and publish:

 function GetUser() {
  var UserId = Xrm.Page.context.getUserId();
 var UserName = Xrm.Page.context.getUserName();
 alert(UserId + " " + UserName);

}

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, BI, Web, Cloud and Data Science.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *