第 16 题
Question#16Topic1
Power Platform 解决方案包括以下 Web API 调用:
GET http://contoso.crm.dynamics.com/api/data/v9.1/RelationshipDefinitions?$select=SchemaName
您需要解释一下这行代码是做什么的。
这段代码是做什么的?
查看答案与解析
答案
解析
可以使用RelationshipDefinitions 实体集查询实体关系。您可以使用如下查询获取每个关系的 SchemaName 属性。
GET [Organization URI]/api/data/v9.0/RelationshipDefinitions?$select=SchemaName
查询时可用的属性此实体集仅限于 RelationshipMetadataBase EntityType 中的实体集。
注意:您可以在给定实体的上下文中检索关系元数据,其方式与查询属性的方式大致相同。可以查询 ManyToManyRelationships、
ManyToOneRelationships 和 OneToManyRelationships 集合值导航属性,就像查询 Attributes 集合值导航属性一样。
但是,也可以使用 RelationshipDefinitions 实体集查询实体关系。
参考资料:
https://docs.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-metadata-web-api https://docs.microsoft.com/zh-cn/power-apps/developer/data-platform/webapi/reference/relationshipmetadatabase?view=dataverse-latest