How to get the logged in user using C# and UserId
using Microsoft.Xrm.Tooling.Connector; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Query; Add the code. We will first get the user id, then perform a retrieve to get the user’s name: try { var connectionString = @"AuthType = Office365; Url = https://yourtenant.crm.dynamics.com/; Username=yourusername; Password=yourpassword " ; CrmServiceClient conn = new CrmServiceClient(connectionString); IOrganizationService service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient ; (IOrganizationService)conn.OrganizationServiceProxy; // Get...