How to get the Impersonation User Id(systemUserId ) in D365
public Guid getUserId(IOrganizationService service, string userName) { Guid systemUserId = Guid.Empty; try { QueryByAttribute queryByAttribute = new QueryByAttribute("systemuser"); ColumnSet columns = new ColumnSet("systemuserid"); queryByAttribute.AddAttributeValue("fullname", userName); EntityCollection retrieveUser = service.RetrieveMultiple(queryByAttribute); systemUserId = ((Entity)retrieveUser.Entities[0]).Id; } catch (FaultException<OrganizationServiceFaul...