Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Attribute display names from the account entity

Posted on by 155

I am trying to get all the attribute display names from the account entity.

I am using CRM 4.0 on premise so XRMToolBox is not an option.

I tried the following SQL query

Select  * from  [MetadataSchema].[Attribute] a  inner join [MetadataSchema].[Entity] e on  e.EntityId=a.EntityId where e.Name='account'

 

But it only has the Name and PhysicalName and not the display name.

What is the correct SQL query to get all the attribute display names from the account entity?

  • Gansea Profile Picture
    Gansea 155 on at
    RE: Attribute display names from the account entity

    Perfect, exactly what I was looking for.

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Attribute display names from the account entity

    Hi Gansea,

    This SQL query obtains all the attribute display names from the account entity for Dynamics CRM 4.0.

    USE Contoso_MSCRM
    GO
    
    SELECT  EntityView.Name AS EntityName, LocalizedLabelView_1.Label AS EntityDisplayName,
           AttributeView.Name AS AttributeName, LocalizedLabelView_2.Label AS AttributeDisplayName
    FROM    LocalizedLabelView AS LocalizedLabelView_2 INNER JOIN
           AttributeView ON LocalizedLabelView_2.ObjectId = AttributeView.AttributeId RIGHT OUTER JOIN
           EntityView INNER JOIN
           LocalizedLabelView AS LocalizedLabelView_1 ON EntityView.EntityId = LocalizedLabelView_1.ObjectId ON
           AttributeView.EntityId = EntityView.EntityId
    WHERE   LocalizedLabelView_1.ObjectColumnName = 'LocalizedName'
     AND LocalizedLabelView_2.ObjectColumnName = 'DisplayName'
     AND LocalizedLabelView_1.LanguageId = '1033'
     AND LocalizedLabelView_2.LanguageId = '1033'
     AND EntityView.Name IN ('Account')
    ORDER BY EntityName, AttributeName

    Dynamics CRM 4.0 supports multiple languages and uses a table called LocalizedLabelView to save the attribute display names. 1033 is the LanguageId for English (US) so you will need to alter the SQL query to use another language code if you use another language. This SQL query will not work for Dynamics CRM 3.0, but it is possible to create a SQL query tailored to Dynamics CRM 3.0.

    pastedimage1600291102925v1.png

  • Gansea Profile Picture
    Gansea 155 on at
    RE: Attribute display names from the account entity

    How can I incorporate the attributemetadata table into my SQL query?

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Attribute display names from the account entity

    Hi,

    Please use attributemetadata table to get the display name.

    docs.microsoft.com/.../attributemetadata

    Please mark my answer verified if i were helpful

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans