dynamics-crm - 如何获取任何 crm 实体属性的 edm 数据类型(odata 类型)
问题描述
GET [Organization URI]/api/data/v9.0//EntityDefinitions(LogicalName=account)/Attributes?$select=LogicalName,AttributeType,AttributeOf
此 api 为我提供 Picklist、Money 等数据类型(crm 数据类型),我正在寻找的是 edm 数据类型,如 Edm.Int32(picklist)、Edm.Decimal(Money)
解决方案
据我所知,元数据缺少对本机 .NET 类型的任何引用。
此表提供映射。
这是我在代码中映射它们的一种方式:
var dictionary = new Dictionary<AttributeTypeCode, Type>
{
{AttributeTypeCode.Integer, typeof(int) },
{AttributeTypeCode.BigInt, typeof(long) },
{AttributeTypeCode.Decimal, typeof(decimal) },
{AttributeTypeCode.Double, typeof(double) },
{AttributeTypeCode.DateTime, typeof(DateTime) },
{AttributeTypeCode.Money, typeof(decimal) },
};
推荐阅读
- php - 将 MySQL 数据读入 Bootstrap 4 列
- node.js - 添加代理以响应 package.json 后,不断收到“代理错误:无法代理请求”错误
- java - 如何唤醒不同实例的线程?
- python-3.x - 启动器中的致命错误:无法使用“c:\ci\spyder_1563210361503\_h_env\pythonw.exe”“D:\anaconda3.7\Scripts\spyder3.exe”创建进程
- python - 使用 django-filter 库和 CBV 进行分页
- javascript - 在 React Native 中创建时间线
- android - 如何使用主活动中的按钮从主活动向片段布局添加随机颜色
- swift - PieChart 在 swift 上使用图表。需要删除元素的值
- bioinformatics - Platanus_allee 基因组组装程序失败的组装错误
- javascript - django 没有给我文件,即使它的链接被定向到文件