In this article, we will discuss OData in Dynamics Portal. The Dynamics portal has a feature of Open Data Protocol. We can use this feature in our public-facing portals.
What is OData?
OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming REST APIs. It enables creation of REST-based services that allow resources identified using Uniform Resource Locators (URLs) and defined in a data model, to be published and edited by Web clients using simple HTTP messages.
Dynamic CRM mainly uses Windows Communication Foundation (WCF) data services framework to provide OData Endpoint which is nothing but a REST-based data service.
So, let's discuss step by step: -
1. Create an Entity List. I am creating an Entity list of Account with name My accounts.
2. Now Scroll down, there is a tab of OData Feed, enable checkbox and in Setting, section put Entity Type Name, Entity Set Name and Select a View.
3. Now Save it.
Now Let’s test OData: -
<Portal URL>/_odata - This will give you all Entity list in which we have enabled OData Feeds.
I am putting <Portal URL>/_odata/<Entity Set Name> in browser and can see the Results as below.