Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Microsoft Dynamics CRM 2016

You're reading from   Mastering Microsoft Dynamics CRM 2016 An advanced guide for effective Dynamics CRM customization and development

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781786466617
Length 402 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Deepesh Somani Deepesh Somani
Author Profile Icon Deepesh Somani
Deepesh Somani
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. History of Dynamics CRM FREE CHAPTER 2. Working with Sales 3. Working with Services 4. Working with Marketing 5. Working with the XRM Framework 6. Analytics with CRM 7. Workflow Development with Dynamics CRM 8. Client-Side Scripting 9. Enhancements for Mobile 10. Plugin Development with Dynamics CRM 11. Business Process Flows and Business Rules 12. New Features in CRM 2016

Scenario 3


Andy is working on a solution in which he needs to populate the fields of an entity into an option set. He wants to load the option set dynamically. To retrieve the fields of a particular entity, you can query the metadata using the Web API. All the attributes of an entity can be retrieved using the metadata query. In this scenario, it is demonstrated how the attributes of a Contact entity can be retrieved using a Web API call.

Retrieving metadata using the Web API

Microsoft Dynamics 365 is a metadata-driven application. Sometimes, you need to query the metadata while working with requirements such as those mentioned in this scenario. For this purpose, you can easily query the metadata using the Web API. We will use the EntityDefinitions entity to retrieve the metadata of the Contact entity. The URL will be as follows:

clientURL + "api/data/v8.2/EntityDefinitions(LogicalName='contact')/Attributes"

We will create an HTML web resource and the following is the code to retrieve the metadata...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image