Building InfoPath lookups using OData queries
A feature of InfoPath that makes forms even more useful is the ability to allow fields to be populated with dynamic data coming from static lists, databases, and also web data sources, so that users do not have to remember field values such as part codes and customer numbers. Since you are able to query Dynamics AX data through web queries, we can use these queries to create dynamic lookups in our forms.
In this recipe, we will show how you can turn text fields into drop-down lists that use OData queries as a data source.
How to do it...
To use an OData query as a data source for a field, follow these steps:
We need to first define the data source. To do this, select the From XML File option in the From Other Sources menu in the Get External Data group of the Data ribbon bar in the form designer.
When the Data Connection Wizard pops up, paste the URL for the OData query that you want to use as a data source and click on Next.
To store the data source...