使用web api检索实体元数据 [英] Retrieving Entity Metadata using web api

查看:100
本文介绍了使用web api检索实体元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要检索实体的元数据。
确切要求:我正在读取表格上的字段值,该表格具有实体模式名称。有了这个,我需要获得该Entity的主键模式名称。可能吗?如果是这样,请帮助我。
例如:在该字段中,如果我输入lead,那个web api应该取给我leadid并将其存储在另一个字段中。
2.如果我输入事件,那个网络API应该让我煽动

we have a requirement where we have to retrieve an Entity's Metadata. Exact requirement: Im reading a field value on a form which ia having "entity schema name". With that I need to get that Entity's primary key schema name. Is it possible? If so please help me. Eg: in that field if I enter "lead" , that web api should fetch me "leadid" and store it in another field. 2. If I enter "incident" , that web api should get me "incidentid"

推荐答案

你不要需要为此检索实体元数据,主键始终是实体模式名称+id,该规则没有例外。如果您仍想检索元数据,您应该可以通过以下方式进行检索:

You don't need do retrieve entity metadata for that, primary key is always "entity schema name" + "id", there are no exceptions from that rule. If you still want to retrieve metadata, you should be able to do it by calling:

https://crmaddress/api/data/v8.2/EntityDefinitions(LogicalName='account')/Attributes?$select=LogicalName

这将返回实体account的所有属性,主键是没有任何@ odata.type属性的那个

That would return all attributes for entity "account", primary key is the one without any "@odata.type" attribute

这篇关于使用web api检索实体元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆