第 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