Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Retrieve Attributes from Record without EntityMetadataID

(0) ShareShare
ReportReport
Posted on by 20

Hey everybody,

first of all sorry for my bad english. Please correct me if anything is wrong.

My goal:

I want to create a Button. On click I want to get all Attributes Metadata of the current entity. 

My current progress:

I retrieve the MetadataId using OData query.

  1. I retrieve the EntityMetadataId.
  2. With the EntityMetadataId I retrieve all Attributes Metadata.

My question:

Is it possible to skip first step and retrieve Attributes Metadata using Entity LogicalName or any other possiblely way? If somebody can explain me why I need to query EntityMetadataId first and then Attribute Metadata.

Thanks for all and 

Best Regards

  • David Jennaway Profile Picture
    14,065 on at
    RE: Retrieve Attributes from Record without EntityMetadataID

    To clarify, there are 2 different operations that you might want to do:

    1. Get a list of all available attributes for an entity. This is the attribute metadata, and will return a list of all attributes, but no record data. For this you first call EntityDefinitions to get the EntityMetadataID, then a second call to EntityDefinitions with the EntityMetadataID to expand the list of attributes
    2. Get data values for attributes for a specific record. For this you just need the entity name and Id, as per below:

    /api/data/v8.2/account(6AB98B9A-72F9-E911-8427-00155DB22303)

    All the above are when using the Web API to get data programmatically

  • Tiras2810 Profile Picture
    20 on at
    RE: Retrieve Attributes from Record without EntityMetadataID

    Thanks Thangamani for detailed explantation.

    @Kokulan Eswaranathan: This exactly what I wanna do.

  • Kokulan Profile Picture
    18,054 on at
    RE: Retrieve Attributes from Record without EntityMetadataID

    Hi

    Just wanted to make sure I've got your question right first if you dont mind. Am I right in saying you want to query and get list of all the attributes that have values for a particular entity record via Web API? If this is not what you are trying to achieve, please provide a bit more detail on your requirement so that we might be able to suggest alternative options.

    Thanks

  • Suggested answer
    Thangamani Profile Picture
    507 on at
    RE: Retrieve Attributes from Record without EntityMetadataID

    Hi Daniel,

     I understood from your reply that you are trying to retrieve a record values using the entity record id via Odata query a syou mentioned like below.

    /api/data/v8.2/EntityDefinitions?$filter=LogicalName%20eq%20'" + entityName + "'&$select=MetadataId".

    Odata is a way that uses Organisation data to get the details from the database and it is the light weight queries to get the required data from client side.It is the structured way to get the data for client side provided by microsoft.Pls go through the below link for your reference.

    www.inogic.com/.../

    But why I can´t only use

    "Data=entityName%3dquote%26recordId%3d%7b6AB98B9A-72F9-E911-8427-00155DB22303%7d"?

    For this you cannot use this way since this is a URL of a record and this will have all the information of a record form.This link you can use it in the client side script whenever you want to open a record form on end of some action.Eventhough this is a URL and it will not in a REST format to retrieve the details from database end.

    Hope this helps you.

    Regards,

    Thangamani

  • Tiras2810 Profile Picture
    20 on at
    RE: Retrieve Attributes from Record without EntityMetadataID

    Thanks Thagamani for your response. I think I have my question not correct explained.

    So i don´t know why I need the EntityMetadataId to get all in used values of a record when the URL shows me link this:

    Data=entityName%3dquote%26recordId%3d%7b6AB98B9A-72F9-E911-8427-00155DB22303%7d

    I remember that people told me first I have to retrieve the EntityMetadataId like this:

    /api/data/v8.2/EntityDefinitions?$filter=LogicalName%20eq%20'" + entityName + "'&$select=MetadataId"

    But why I can´t only use "Data=entityName%3dquote%26recordId%3d%7b6AB98B9A-72F9-E911-8427-00155DB22303%7d"?

    All the best,

    Daniel

  • Suggested answer
    Thangamani Profile Picture
    507 on at
    RE: Retrieve Attributes from Record without EntityMetadataID

    Hello,

          As per your query,you can get the Entity metadata Id and using the Entity metadata Id you will be able to get the Attribute metadata id which is created for that entity via CRM Service.

    You will not be able to get the control of that particular Entity using Entitymetadata Id,since Button is a control of the form and it has its own id and onclick of that button you can call the javascript to achieve the functionality.

    Please clarify with them the requirement.

    Hope this helpful.

    Regards,

    Thangamani

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 91

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans