【问题标题】:Get specific CRM organization instead of all获取特定的 CRM 组织而不是全部
【发布时间】:2020-04-29 08:57:46
【问题描述】:

CRM 本地环境中有多个组织。我已将 DiscoveryService URL 和组织名称存储在配置文件中。

我想使用配置文件中可用的组织名称获取特定组织的组织实例,而不是加载所有组织。

类似的东西,

select organizations from Organizations where orgName = 'XYZ'

目前,我正在使用以下代码,检索实例需要 3 秒以上。

private OrganizationDetail DiscoverOrganization(Uri discoveryUri, string organizationName, ClientCredentials lclClientCredentials)
        {
            DiscoveryServiceProxy serviceProxy;
            using (serviceProxy = new DiscoveryServiceProxy(discoveryUri, null, lclClientCredentials, null))
            {
                IDiscoveryService service = serviceProxy;
                var orgsRequest = new RetrieveOrganizationsRequest() { AccessType = EndpointAccessType.Default, Release = OrganizationRelease.Current };
                var organizations = (RetrieveOrganizationsResponse)service.Execute(orgsRequest);
                return organizations.Details.FirstOrDefault(x => x.UniqueName.ToLower() == organizationName.ToLower());
            }
        }

【问题讨论】:

  • 你试过了吗?

标签: dynamics-crm crm organization


【解决方案1】:

你也可以试试 web api 版本。 Read more

GET https://dev.{servername}/api/discovery/v9.0/Instances(UniqueName='myorg')

【讨论】:

  • 我正在尝试访问自定义 WCF 服务中的 CRM 发现 URL。所以我没有用户名和密码。
猜你喜欢
  • 2018-01-24
  • 1970-01-01
  • 2017-04-29
  • 1970-01-01
  • 1970-01-01
  • 2013-05-30
  • 2020-03-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多