Defining our first query
In our first query, we will try to retrieve the items that our customers buy per month. To do so, we will use the Item Ledger Entry
table as our main data source, but we will also use the Customer
and the Item
tables to get additional information from customers and items, such as their name or description.
First let's define the main data source and the fields that will be retrieved:
- Open the Object Designer window in the Microsoft Dynamics NAV Development Environment and select the Query object type on the left pane of the Object Designer window.
- Click on New to create a new query.
- An empty Query Designer window will open.
- On the first line, in the Type column, choose DataItem from the drop-down list.
Tip
The first line in the Query Designer window must be a DataItem field and not a Column field.
- Select Item Ledger Entry in the Data Source column.
Tip
You can choose the up arrow that will appear on the right-hand side of the Data Source column when you...