Wednesday, 27 May 2015

SQL STATEMENT IN AX X++ CODE

SQL statement in Ax code x++ generated 

So here is another small tip based on me reading Inside Microsoft Dynamics AX 2012 R3.

If you want to know what SQL statement the SQL Server query processor generates based on a regular X++ select statement, you can add to the keyword generateOnly to the statement and afterwards call the getSQLStatement method on the record buffer.

Example:
   AccountingEvent         accountingEvent;
   SourceDocumentHeader sourceDocumentHeader;

   select generateonly accountingEvent
   join sourceDocumentHeader
    where sourceDocumentHeader.RecId == accountingEvent.SourceDocumentHeader;

   info (accountingEvent.getSQLStatement());

No comments:

Post a Comment

AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...