When you are debugging your solution you sometimes might want to see the SQL Query the Dynamics AX Kernel has generated for your Form.
While you can of course trace this directly at your Database Server, you also can do this in X++ using the QueryBuildDataSource class.
Let's imagine you have a Form that has PurchTable as Data Source. You have to override the executeQuery method of the PurchTable Data Source and add the following code:
public void executeQuery()
{
Query q;
QueryBuildDataSource qbds;
;
q = this.query();
qbds = q.dataSourceName("PurchTable"); //Replace with the current Table
info( qbds.toString() );
super();
}
{
Query q;
QueryBuildDataSource qbds;
;
q = this.query();
qbds = q.dataSourceName("PurchTable"); //Replace with the current Table
info( qbds.toString() );
super();
}
No comments:
Post a Comment