Hello - I'm using the following query to get the domainname for a user guid:
var domainName =
context.OrganizationService.Retrieve(
SystemUser.EntityLogicalName, userGuid, new ColumnSet(new string[] { "DomainName" }))
.ToEntity<SystemUser>().DomainName;
However, this query is returning the following error:
Exception: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: 'SystemUser' entity doesn't contain attribute with Name = 'DomainName'.
SystemUser does have a DomainName field, I even double checked the spelling. So do you have any idea why the query above might be throwing the exception above?
*This post is locked for comments