Dynamics CRM 快速获取custom entity

Posted themiao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Dynamics CRM 快速获取custom entity相关的知识,希望对你有一定的参考价值。

我们可以使用Command来实现快速获取custom entity的值.

创建cmd  并且在nuget中引用 CRMSDK

技术图片

 

复制下面的代码.

userName 为登陆CRM的email

password 为登陆CRM密码

 

url 是 svc

可以在这里找到: Settings -> Customizations -> Developer Resources -> Organization Source

    public class RetrieveCustomEntities
    {
        public OrganizationServiceProxy serviceProxy { get; set; }

        public void RetrieveustomEntity()
        {
            var clientCredentials = new ClientCredentials();
            // input the user name
            clientCredentials.UserName.UserName = "your user name";
            // input the pass word
            clientCredentials.UserName.Password = "Your Password";

            // input your instance svc url
            using (serviceProxy = new OrganizationServiceProxy(new Uri("url"), null, clientCredentials, null))
            {
                serviceProxy.EnableProxyTypes();
                // input the logical name of the entity
                var query = new QueryExpression("entity logical name");
                query.ColumnSet = new ColumnSet();
                query.ColumnSet.AddColumn("condition");
                var retrievedValue = serviceProxy.RetrieveMultiple(query);
            }
        }
    }

 

以上是关于Dynamics CRM 快速获取custom entity的主要内容,如果未能解决你的问题,请参考以下文章

Dynamics CRM2016 Web API之Use custom FetchXML

Dynamics CRM 2015/2016 Web API:Unbound Custom Action 和 Bound Custom Action

创建一个dynamics CRM workflow - Deploy Custom Workflows

Create Custom APIs in Dynamics 365 CRM | Power Platform

Create Custom APIs in Dynamics 365 CRM | Power Platform

创建一个dynamics CRM workflow - Development of Custom Workflows