csharp CRM 2016 #Client #Connection #CrmServiceClient#CRM2016 #MoussaElAnnan

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp CRM 2016 #Client #Connection #CrmServiceClient#CRM2016 #MoussaElAnnan相关的知识,希望对你有一定的参考价值。

var task1 = await Task.Factory.StartNew(() =>
{
 var crmSvc = new CrmServiceClient("AuthType=AD;Url=https://urlName/organizationName;Domain=domainName;Username=userName;Password=password");

 if (crmSvc.IsReady)
 {
     label1.Label = "Connected !";
     Thread.Sleep(1000);
     label1.Label = "Getting user name from CRM !";
     var ctx = new XrmServiceContext(crmSvc);
     var systemUser = ctx.SystemUserSet.FirstOrDefault(p => p.FullName == mailItem.SenderName);
     return systemUser;
 }
 return null;
});
 label1.Label = task1 != null ? task1.DomainName : "Not found !";

以上是关于csharp CRM 2016 #Client #Connection #CrmServiceClient#CRM2016 #MoussaElAnnan的主要内容,如果未能解决你的问题,请参考以下文章

csharp CRM 2016 #UnitTests#CRM2016 #MoussaElAnnan

csharp CRM 2016 #Emails#C#CRM2016 #MoussaElAnnan

csharp CRM 2015-2016 C ##Plugins #Metadata#CRM2016 #MoussaElAnnan

csharp CRM 2015-2016 C#Helper #Teams #Sharing#CRM2016 #MoussaElAnnan

csharp CRM 2016 C ## C ##OptionSets #MoussaElAnnan

Grid (read-only) objects and methods (client-side reference)获取子表单对象的一些方法 Crm 2016