Microsoft DataVerse WebAPI 字段/属性名称、逻辑名称还是模式名称?
我目前正在动态创建ODATA查询,以使数据从数据传说中获取。我遇到的问题是您在$选择查询中指定的每个字段/属性的名称似乎会更改betweek logicalName和schemaname。有没有办法确定何时使用逻辑以及何时使用模式? For example, the following query has to use logical for createdby but schema for CreatedByExternalParty
https://xxx.crm11.dynamics.com/api/data/v9.0/accounts(27cacceb-2a0b-ec11-b6e5-0022484220b6)?$select= name &$expand= createdby ( $select= fullname ), CreatedByExternalParty ( $select= fullname )
If I query the EntityDefinition for each of the above two fields, I can't see any difference between them in terms of metadata:
"@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata",
"Targets": [
"externalparty"
],
"Format": "None",
"AttributeOf": null,
"AttributeType": "Lookup",
"ColumnNumber": 230,
"DeprecatedVersion": null,
"IntroducedVersion": "8.0.0.0",
"EntityLogicalName": "account",
"IsCustomAttribute": false,
"IsPrimaryId": false,
"IsValidODataAttribute": true,
"IsPrimaryName": false,
"IsValidForCreate": false,
"IsValidForRead": true,
"IsValidForUpdate": false,
"CanBeSecuredForRead": false,
"CanBeSecuredForCreate": false,
"CanBeSecuredForUpdate": false,
"IsSecured": false,
"IsRetrievable": false,
"IsFilterable": false,
"IsSearchable": false,
"IsManaged": true,
"LinkedAttributeId": null,
"LogicalName": "createdbyexternalparty",
"IsValidForForm": true,
"IsRequiredForForm": false,
"IsValidForGrid": true,
"SchemaName": "CreatedByExternalParty",
"ExternalName": null,
"IsLogical": false,
"IsDataSourceSecret": false,
"InheritsFrom": null,
"CreatedOn": "1900-01-01T00:00:00Z",
"ModifiedOn": "1900-01-01T00:00:00Z",
"SourceType": null,
"AutoNumberFormat": "",
"MetadataId": "827e9002-b547-49fc-9e8d-a6b1cfcef33b",
"HasChanged": null,
"AttributeTypeName": {
"Value": "LookupType"
}
"@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata",
"Targets": [
"systemuser"
],
"Format": "None",
"AttributeOf": null,
"AttributeType": "Lookup",
"ColumnNumber": 52,
"DeprecatedVersion": null,
"IntroducedVersion": "5.0.0.0",
"EntityLogicalName": "account",
"IsCustomAttribute": false,
"IsPrimaryId": false,
"IsValidODataAttribute": true,
"IsPrimaryName": false,
"IsValidForCreate": false,
"IsValidForRead": true,
"IsValidForUpdate": false,
"CanBeSecuredForRead": false,
"CanBeSecuredForCreate": false,
"CanBeSecuredForUpdate": false,
"IsSecured": false,
"IsRetrievable": false,
"IsFilterable": false,
"IsSearchable": false,
"IsManaged": true,
"LinkedAttributeId": null,
"LogicalName": "createdby",
"IsValidForForm": true,
"IsRequiredForForm": false,
"IsValidForGrid": true,
"SchemaName": "CreatedBy",
"ExternalName": null,
"IsLogical": false,
"IsDataSourceSecret": false,
"InheritsFrom": null,
"CreatedOn": "1900-01-01T00:00:00Z",
"ModifiedOn": "1900-01-01T00:00:00Z",
"SourceType": null,
"AutoNumberFormat": "",
"MetadataId": "b863fe8a-6393-42ec-a540-972d3b45bd7b",
"HasChanged": null,
"AttributeTypeName": {
"Value": "LookupType"
}
Any help would be great, thanks 。
I am currently creating oData queries dynamically to get data out of dataverse. The problem I have is the name for each field/attribute that you specify in the $select query seems to change betweek LogicalName and SchemaName. Is there a way to determine when to use logical and when to use schema? For example, the following query has to use logical for createdby but schema for CreatedByExternalParty
https://xxx.crm11.dynamics.com/api/data/v9.0/accounts(27cacceb-2a0b-ec11-b6e5-0022484220b6)?$select= name &$expand= createdby ( $select= fullname ), CreatedByExternalParty ( $select= fullname )
If I query the EntityDefinition for each of the above two fields, I can't see any difference between them in terms of metadata:
"@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata",
"Targets": [
"externalparty"
],
"Format": "None",
"AttributeOf": null,
"AttributeType": "Lookup",
"ColumnNumber": 230,
"DeprecatedVersion": null,
"IntroducedVersion": "8.0.0.0",
"EntityLogicalName": "account",
"IsCustomAttribute": false,
"IsPrimaryId": false,
"IsValidODataAttribute": true,
"IsPrimaryName": false,
"IsValidForCreate": false,
"IsValidForRead": true,
"IsValidForUpdate": false,
"CanBeSecuredForRead": false,
"CanBeSecuredForCreate": false,
"CanBeSecuredForUpdate": false,
"IsSecured": false,
"IsRetrievable": false,
"IsFilterable": false,
"IsSearchable": false,
"IsManaged": true,
"LinkedAttributeId": null,
"LogicalName": "createdbyexternalparty",
"IsValidForForm": true,
"IsRequiredForForm": false,
"IsValidForGrid": true,
"SchemaName": "CreatedByExternalParty",
"ExternalName": null,
"IsLogical": false,
"IsDataSourceSecret": false,
"InheritsFrom": null,
"CreatedOn": "1900-01-01T00:00:00Z",
"ModifiedOn": "1900-01-01T00:00:00Z",
"SourceType": null,
"AutoNumberFormat": "",
"MetadataId": "827e9002-b547-49fc-9e8d-a6b1cfcef33b",
"HasChanged": null,
"AttributeTypeName": {
"Value": "LookupType"
}
"@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata",
"Targets": [
"systemuser"
],
"Format": "None",
"AttributeOf": null,
"AttributeType": "Lookup",
"ColumnNumber": 52,
"DeprecatedVersion": null,
"IntroducedVersion": "5.0.0.0",
"EntityLogicalName": "account",
"IsCustomAttribute": false,
"IsPrimaryId": false,
"IsValidODataAttribute": true,
"IsPrimaryName": false,
"IsValidForCreate": false,
"IsValidForRead": true,
"IsValidForUpdate": false,
"CanBeSecuredForRead": false,
"CanBeSecuredForCreate": false,
"CanBeSecuredForUpdate": false,
"IsSecured": false,
"IsRetrievable": false,
"IsFilterable": false,
"IsSearchable": false,
"IsManaged": true,
"LinkedAttributeId": null,
"LogicalName": "createdby",
"IsValidForForm": true,
"IsRequiredForForm": false,
"IsValidForGrid": true,
"SchemaName": "CreatedBy",
"ExternalName": null,
"IsLogical": false,
"IsDataSourceSecret": false,
"InheritsFrom": null,
"CreatedOn": "1900-01-01T00:00:00Z",
"ModifiedOn": "1900-01-01T00:00:00Z",
"SourceType": null,
"AutoNumberFormat": "",
"MetadataId": "b863fe8a-6393-42ec-a540-972d3b45bd7b",
"HasChanged": null,
"AttributeTypeName": {
"Value": "LookupType"
}
Any help would be great, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 dataverse 论坛上用户的帮助下,我找到了答案,特别是 Guido Preite,他提供了优秀的开源工具 Dataverse 请求Builder
我从他的代码中找到了答案,CreatedByExternalParty的外壳来自于调用RelationshipDefinitions时的导航属性。
回复:
I found the answer, with help from users on the dataverse forums, especially Guido Preite for providing the excelent open source tool Dataverse Request Builder
I found the answer from his code, the casing of the CreatedByExternalParty comes from the navigation property when calling RelationshipDefinitions.
response: