Dynamics CRM 快速获取custom entity
2024-09-06 16:30:09
我们可以使用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);
}
}
}
最新文章
- centos6.3与jexus5.4.4配置支持php(wordpress)
- Salesforce Apex 开发环境设置和Hello World示例
- Python3学习(二)-递归函数、高级特性、切片
- 字符串匹配算法——KMP算法
- C#GDI+基础(三)画刷详解
- Swift3.0语言教程使用指针创建和初始化字符串
- 论文笔记之:Speed Up Tracking by Ignoring Features
- Android QQ空间浏览图片动画特效的实现(※)
- phpcms v9
- 解决弹出的窗口window.open会被浏览器阻止的问题(自定义open方法)
- 使用JMeter做压力测试
- MySql移植到嵌入式Linux平台
- List列表 OrderBy
- instanceof问题
- css文本超出省略号
- qemu与libvirt编译与安装
- pageadmin CMS自助建站系统教程:模板中执行sql语句
- Windows 7 上面安装 dotnet core 之后 使用 应用报错的处理:api-ms-win-crt-runtime-l1-1-0.dll 丢失
- 洛谷 P4112 [HEOI2015]最短不公共子串 解题报告
- SQL Server 登录名、服务器角色、用户名和数据库角色 --- 解释