web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

OData $select on Complex Type

(0) ShareShare
ReportReport
Posted on by

The OData Service is returning null when I $select on an inner complex type.

For query: [tenant]/api/data/v9.0/EntityDefinitions(LogicalName='account')?$select=DisplayName

The response is:

{
   "@odata.context": "fpx-dev02.api.crm.dynamics.com/.../v9.0$metadata#EntityDefinitions(DisplayName)/$entity",
   "MetadataId": "70816501-edb9-4740-a16c-6a5efbc05d84",
   "DisplayName": {
      "LocalizedLabels": [
         {
            "Label": "Account",
            "LanguageCode": 1033,
            "IsManaged": true,
            "MetadataId": "2a4901bf-2241-db11-898a-0007e9e17ebd",
            "HasChanged": null
         }
      ],
      "UserLocalizedLabel": {
         "Label": "Account",
         "LanguageCode": 1033,
         "IsManaged": true,
         "MetadataId": "2a4901bf-2241-db11-898a-0007e9e17ebd",
         "HasChanged": null
      }
   }
}
I want to filter this response to only include LocalizedLabels and not UserLocalizedLabel.

For Query:

[tenant]/api/data/v9.0/EntityDefinitions(LogicalName='account')?$select=DisplayName/Microsoft.Dynamics.CRM.Label/LocalizedLabels
{
   "@odata.context": "fpx-dev02.api.crm.dynamics.com/.../v9.0$metadata#EntityDefinitions(DisplayName/Microsoft.Dynamics.CRM.Label/LocalizedLabels)/$entity",
   "MetadataId": "70816501-edb9-4740-a16c-6a5efbc05d84",
   "DisplayName": null
}

I was expecting DisplayName to be

DisplayName": {
      "LocalizedLabels": [
         {
            "Label": "Account",
            "LanguageCode": 1033,
            "IsManaged": true,
            "MetadataId": "2a4901bf-2241-db11-898a-0007e9e17ebd",
            "HasChanged": null
         }
      ]
}
Is this a bug in Dynamics, or is my $select wrong?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    Here is the Metadata Involved:

    <EntitySet Name="EntityDefinitions" EntityType="Microsoft.Dynamics.CRM.EntityMetadata"> <NavigationPropertyBinding Path="Microsoft.Dynamics.CRM.BooleanAttributeMetadata/GlobalOptionSet" Target="GlobalOptionSetDefinitions"/> <NavigationPropertyBinding Path="ManyToManyRelationships" Target="RelationshipDefinitions"/> <NavigationPropertyBinding Path="ManyToOneRelationships" Target="RelationshipDefinitions"/> <NavigationPropertyBinding Path="OneToManyRelationships" Target="RelationshipDefinitions"/> <NavigationPropertyBinding Path="Microsoft.Dynamics.CRM.EnumAttributeMetadata/GlobalOptionSet" Target="GlobalOptionSetDefinitions"/> </EntitySet>

    <EntityType Name="EntityMetadata" BaseType="mscrm.MetadataBase">
    ...
    <Property Name="ActivityTypeMask" Type="Edm.Int32"/>
    <Property Name="AutoRouteToOwnerQueue" Type="Edm.Boolean"/>
    <Property Name="CanTriggerWorkflow" Type="Edm.Boolean"/>
    <Property Name="Description" Type="mscrm.Label"/>
    <Property Name="DisplayCollectionName" Type="mscrm.Label"/>
    <Property Name="DisplayName" Type="mscrm.Label"/>
    ...
    </EntityType>
    <ComplexType Name="Label">
    <Property Name="LocalizedLabels" Type="Collection(mscrm.LocalizedLabel)"/>
    <Property Name="UserLocalizedLabel" Type="mscrm.LocalizedLabel"/>
    </ComplexType>
    <ComplexType Name="LocalizedLabel">
    <Property Name="Label" Type="Edm.String" Unicode="false"/>
    <Property Name="LanguageCode" Type="Edm.Int32"/>
    <Property Name="IsManaged" Type="Edm.Boolean"/>
    <Property Name="MetadataId" Type="Edm.Guid"/>
    <Property Name="HasChanged" Type="Edm.Boolean"/>
    </ComplexType>

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    It does look like a bug or limitation. When you try to access complex type, you get the below error message-

    testcrmaug.crm6.dynamics.com/.../EntityDefinitions(LogicalName='account')/DisplayName?$select=LocalizedLabels

    "query parameters not supported on complex type."

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans