Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8956353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:46:19+00:00 2026-06-15T14:46:19+00:00

When retrieving a CRM entity including all attributes, in some cases some of the

  • 0

When retrieving a CRM entity including all attributes, in some cases some of the attributes with the type EntityReference have no name. In that case the ID of the reference is set but its Name property is null.

I have to use the name for some evaluation. Thus I was trying to query that referenced entity to get its name. The problem is, that the attribute that contains the entity name differs for different entity types.

(e.g. for Account it’s “name”, for Incident it’s “title” and for other types it’s “somePrefix_name_or_so”)

Is there an easy way to get the entity name (Name property of an entity reference) using the CRM-SDK and a query?

Additional details:
The code is located in a CRM plugin. There the pre/post image normally contains all attributes, but in some cases during an update, (nearly) all entity references lose their names. The attributes in the dictionary are still there including the EntityReference objects. Only the Name property of the EntityReference instances is null.

My approach so far:

  • Retrieve entity in plugin
  • Get specific attribute (type: EntityReference)
  • Get name of that EntityReference
    • if that name is null, do a query to get that name (help! How?)
  • Use that name in some logic
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:46:20+00:00Added an answer on June 15, 2026 at 2:46 pm

    For this you need to have EntityMetadata of the entity for which you have EntityReference. Then you can take EntityMetadata.PrimaryNameAttribute property, it contains name of the attribute of primary name. Given that attribute name you can obtain what you want.
    See more info about this property here: http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.entitymetadata.primarynameattribute.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am retrieving JSON using jQuery's getJSON call. My problem is that some of
I'm retrieving some records from a database using user = Users.all in the console
I have a problem retrieving all the data inside the rows added by the
Possible Duplicate: Dynamically retrieving current method's name Obj-C introspection: How can a method reference
I have doubt in retrieving multiple records from DB. Case 1: Apply join, select
We have a flash retrieving information from an XML file. Right now we are
When retrieving data from MySQL, the PHP array output has both numeric and name
i'm retrieving the innerHTML in javascript let say element.innerHTML where all the tag are
So I am retrieving some location data from a form, and submits the form
Hi im retrieving some data from a database using JSON and ajax. When i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.