Today's post on the OData Query Service is by Principal Software Architect Arthur Greef.
Microsoft Dynamics AX 2012 hosts an OData Query Service that uses the Open Data Protocol (OData) protocol to execute queries that are modeled in the Application Object Tree (AOT). The OData protocol is a HTTP protocol for querying and updating data. Microsoft Dynamics AX 2012 supports data query scenarios (with some limitations listed below), but does not support data update scenarios. The following example describes how to read data from the Currency table. The sample assumes that the Application Object Server (AOS) is installed on a machine named ‘aoshost’.
Set up an AOT query that can be executed by the OData Query Service
i. No specific value is required in the Module column.
ii. In the Data source type column, select Query.
iii. In the Data source name column, select or enter the CurrencyQuery.
iv. Select the Activated check box to activate the query as a document data source.
v. Close the Document data sources form.
Using the OData Query Service with Windows Internet Explorer
Note: If Internet Explorer formats the results as a feed, then right-click on the HTML page, and select View source to open the result in Notepad.
Using the OData Query Service with Microsoft PowerPivot
Using the OData Query Service with Microsoft Visual Studio
OData Query Service paging
The OData Query Service returns data in pages that have a length specified in the AX32Serv.exe.config file created under the file system folder created for the AOS. The page size can be modified by editing the configuration file and by restarting the AOS. The default page size is shown in the following XML document fragment.
<add key="ODataQueryPageSize" value="1000" />
OData Query Service limitations
OData Query Service notes
BLOCK #TrvExpTable PROPERTIES Name #TrvExpTable Table #TrvExpTable UniqueId #1000 FetchMode #1:1 ENDPROPERTIES
This posting is provided "AS IS" with no warranties, and confers no rights.