zoukankan      html  css  js  c++  java
  • 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);
                }
            }
        }
  • 相关阅读:
    Nginx 之负载均衡与反向代理
    PHP 之快递100接口封装
    Mongodb非关系型数据库
    Sphinx全文索引引擎
    PHP 之文件上传类封装
    PHP 之验证码类封装
    小程序 之左滑删除
    PHP 之实现按日期进行分组、分页
    System.IO 二
    IIS配置MIME类型
  • 原文地址:https://www.cnblogs.com/TheMiao/p/10847898.html
Copyright © 2011-2022 走看看