queryDataSourceStr Function [AX 2012]

Updated: June 24, 2009

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

This function causes the X++ compiler to check whether the data source exists on the query, and to replace the function call with a string of the valid data source name.

str queryDataSourceStr(queryName, dataSourceName)

Parameter

Description

queryName

The name of the query, not in quotation marks.

dataSourceName

The name of the data source that is on the query, not in quotation marks.

A string that contains the name of the data source as it appears in the AOT.

A compile error is issued if the compiler determines that the data source does not exist on the query. If your X++ code uses a string with quotation marks to supply the data source name, the error cannot be discovered until run time. Use of this function enables the compiler to discover the error earlier at compile time.

X++ functions such as queryDataSourceStr that are executed by the compiler are referred to as intrinsic functions or compile-time functions. That is why the input parameters are not standard strings in quotation marks. Compile-time functions are not represented in the p-code or other executable that is output by the compiler.


Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).

Community Additions

ADD
Show: