The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.


Returns the ID that is assigned to a query column in the query definition.


Number := Query.COLUMNNO(Column)  


Type: Query

A variable that specifies the query object that contains the column.

Type: Text

Refers to the name of the query column. The name of a query column is specified by the Name Property of the column in Query Designer.

Property Value/Return Value

Type: Integer

The number that is assigned to the column.


In Query Designer, each column of the query is assigned a number that is specified by the column's ID Property. The COLUMNNO method enables you to create actions based on the ID of a column.


The following example shows how to get the ID of a column of a query. The query is called My Customer Query and has a column with the name Customer_No. This example requires that you create the following variables.

Variable name DataType Subtype
Number Integer Not applicable
MyQuery Query My Customer Query

This statement assigns the ID of the Customer_No column in the My Customer Query query to the Number variable.

Number := MyQuery.COLUMNNO("Customer_No");  

See Also

Query Object
Record Data Type