Use Dynamics WebAPI to get LogicalName or ObjectTypeCode for Entity

Use Dynamics WebAPI to get LogicalName or ObjectTypeCode for Entity

If you need to get the LogicalName or ObjectTypeCode of an entity in your Dynamics environment you can utilize the WebAPI to get the metadata.

If you have the LogicalName of the entity you can use this url.
Format:
<Dynamics Url>/api/data/v<Version>/EntityDefinitions(LogicalName='<LogicalName>')?$select=ObjectTypeCode

Example:
https://org12345.crm.dynamics.com/api/data/v9.0/EntityDefinitions(LogicalName='account')?$select=ObjectTypeCode

Data Returned:
{"@odata.context":"https://org6744e6cd.crm.dynamics.com/api/data/v9.0/$metadata#EntityDefinitions(ObjectTypeCode)/$entity","ObjectTypeCode":1,"MetadataId":"70816501-edb9-4740-a16c-6a5efbc05d84"}

If you have the ObjectTypeCode of the entity you can use this url.

Format:
<Dynamics Url>/api/data/v<Version>/EntityDefinitions?$filter=ObjectTypeCode eq <ObjectTypeCode>&$select=LogicalName

Example:
https://org12345.crm.dynamics.com/api/data/v9.0/EntityDefinitions?$filter=ObjectTypeCode eq 1&$select=LogicalName

Data Returned:
{"@odata.context":"https://org6744e6cd.crm.dynamics.com/api/data/v9.0/$metadata#EntityDefinitions(LogicalName)","value":[{"LogicalName":"account","MetadataId":"70816501-edb9-4740-a16c-6a5efbc05d84"}]}

Comments

  1. This blog is very interesting and powerful content. I got more important information and it's very useful for improve my knowledge. share more
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete

  2. it is really a great and helpful piece of info. I am glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing.
    malaysian embassy singapore

    ReplyDelete
  3. My Assignment Help Now is a valuable source of getting experts’ help for academic papers. Connecting with the well-qualified professionals helps you to score top grades. Students who have no ideas about how to start their papers, they can search for our superior assignment help service to compose their documents.
    Assignment Help

    ReplyDelete
  4. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.
    Website: Matka Charts

    ReplyDelete
  5. Play fantasy cricket on India's no.1 App and get a chance to win up to 50 lakhs in every match. Download the app now!

    ReplyDelete
  6. Thanks for the information. You have discussed an interesting topic that everybody should know. Keep posting these kind of posts.
    Click here: artificial jewellery

    ReplyDelete
  7. Thanks for sharing this piece of information. I really enjoyed it. keep up the good work and all the very best of luck! I like this post
    Website :- Gas and Electric Geyser near me

    ReplyDelete
  8. Thanks for sharing this information. I have shared this link with others keep posting such information.
    Website house for sale in jaipur

    ReplyDelete
  9. Thank you for sharing such a useful post. Very Interesting Post! I regularly follow this kind of Blog.
    CCC Online Test

    ReplyDelete

Post a Comment

Popular posts from this blog

Add User As Local Administrator On Domain Controller

An error occurred while applying security information to

Display ADFS 2.0 Forms Authentication Login Page Instead of Windows Authentication Prompt