public static SystemUser GetSystemUser(IOrganizationService ser, Guid userid, ColumnSet columnset)
{
try
{
QueryExpression query = GetQueryExpressionSingle("systemuser", "systemuserid", userid, columnset);
EntityCollection ec = ser.RetrieveMultiple(query);
if (ec != null && ec.Entities.Count == 1)
return (SystemUser)ec.Entities[0];
else
return new SystemUser();
}
catch (Exception ex)
{
throw ex;
}
}
GetQueryExpressionSingle metodu
Metot Kullanımı
SystemUser user= CrmManagerStatic.GetSystemUser(crmService, userid, new ColumnSet("systemuserid", "domainname", "internalemailaddress", "siteid"));
Hiç yorum yok:
Yorum Gönder