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)

How do you retrieve custom entities and their properties from the server-side Web API?

(0) ShareShare
ReportReport
Posted on by

The /EntityDefinitions path contains the description pasted below at this page in the documentation, but the description does not specify if custom entities are returned. Are custom entities returned from this endpoint? If not, is there a way to retrieve custom entities?

Contains EntityMetadata EntityType entities

I was not able to find an endpoint to retrieve the properties of entities (as they are listed under each individual entity here, but returned from an API endpoint) which was confirmed by my last community post. Is there a way to retrieve properties for custom entities, or is this also not possible? 

Thank you!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hello Dallas ,

    Could you please check below reference -

    docs.microsoft.com/.../query-metadata-web-api

  • Community Member Profile Picture
    on at

    Hi Goutam - thank you, I have that reference but I went through the sample again and I see the IsCustomOptionSet field, which I assume is showing if the field is a custom field or not...but am I to assume there's no way to get properties for custom fields? I know there's not a way to retrieve properties for the non-custom entities but there are static properties available in the docs, whereas custom fields there would be no way to retrieve that information, correct?

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    I am not sure never tried yet.

    What about below query , seems it's should return if you replace the entity name-

    GET [Organization URI]/api/data/v9.0/EntityDefinitions(LogicalName='account')?$select=LogicalName&$expand=Attributes($select=LogicalName)

  • Suggested answer
    Dilanka H. Profile Picture
    116 on at

    Hi Dallas,

    I should thank you first that I felt not alone when facing the same problem. My no luck that I coult not able to solve my same issue using any of the suggested (verified mostly) answers.

    So, I just tried old school way more than one time and yes it worked finally in a flick!

    What I did was, just go to my Custom Entity and do a change/s which I can recall from memory (ie: not something marked with "†" though, let's say "Allow Quick Create" and Saved > Published the customization. Woala, just check with API URI and it works! Now, you can make that change reverse without fear. It still works.

    I think otherwise, this Metadata Schema won't get updated pretty easily!

    Something important I found that: When you create a custom entity it does not necessarily create it's EntitySetID (in plural) grammatically. Let's say if I created the entity "new_bank" gives me the Metadata Endpoint "new_banks" of course. Just add "s" after the entity name. But when I create "new_bankbranch" unfortunately it created the Endpoint as "new_bankbranchs". Yes, "WITHOUT "E" before "S" !!! We don't necessarily need to expect grammatical correctness here.

    Hope these will help someone save a day :)

  • Muhammet ATALAY Profile Picture
    60 on at

    Hello,

    following returns list of custom entities LogicalName with ObjectTypeCode

    {{webapiurl}}EntityDefinitions()?$select=LogicalName,ObjectTypeCode,IsCustomEntity&$filter=IsCustomEntity eq true

    Response sample; ;

    {

       "@odata.context": "">..../.../$metadata,

       "value": [

           {

               "LogicalName": "msdyn_solutioncomponentdatasource",

               "ObjectTypeCode": 10002,

               "IsCustomEntity": true,

               "MetadataId": "ecd1791d-f952-40c9-a0da-cac34b474849"

           },

    ....

    ....

           {

               "LogicalName": "xyz_customentity1",

               "ObjectTypeCode": 10010,

               "IsCustomEntity": true,

               "MetadataId": "3ec05f5a-f78e-ea11-9664-000d3a98ad7f"

           }

       ]

    }

    enjoy,

  • Suggested answer
    restassured Profile Picture
    60 on at

    I was looking for the exact solution. Thank you so much!

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