Using Trace Parser as a Debugger in Microsoft Dynamics 365 for Finance and Operations (D365FO) - Microsoft Dynamics 365 Vietnam

Microsoft Dynamics 365 Vietnam

Song Nghia - Microsoft Dynamics 365 Vietnam

Breaking

Wednesday, June 19, 2024

Using Trace Parser as a Debugger in Microsoft Dynamics 365 for Finance and Operations (D365FO)

 Using Trace Parser as a Debugger in Microsoft Dynamics 365 for Finance and Operations (D365FO)
x





Trace Parser is a powerful tool in Microsoft Dynamics 365 for Finance and Operations (D365FO) that helps developers debug applications. It provides a detailed view of every SQL statement and method call, including the call stack, which is essential for diagnosing performance issues and understanding application behavior.

Here is a step-by-step guide on how to use Trace Parser as a debugger:

Step 1: Enable Trace Parser Database

  1. Go to System Administration:

    • Navigate to System administration > Check Performance tools.


  2. Validate and Save:

    • Leave the default parameters as they are, and click Validate then Save.
    • This action will generate a Trace Parser database on the local SQL Server machine and bind SQL server query parameters.


Step 2: Start Tracing the Application

  1. Start Trace:

    • Go to the application you want to trace.
    • Before starting any operations, click on Trace.


  2. Name the Trace Session:

    • Give the trace session a name, such as "test".
    • Click Start Trace.


Step 3: Perform Operations in the Application

  • Carry out the tasks you want to trace in the application.
  • When finished, click Stop Trace.


Step 4: Download the Trace

  • Click on Download Trace.
  • Save the trace file to your desired location on your computer.



Step 5: Open Trace Parser

  1. Search for Trace Parser:

    • Search for "Trace Parser" in the Windows menu and open it.


  2. Register a New Database (First Time Only):

    • The first time you use Trace Parser, you need to register a new database.
    • Select localhost > traceparser and click Register.


Step 6: Import the Trace File

  1. Import the Trace File:
    • After the database is created, click on Import trace.
    • Locate and select the trace file you downloaded earlier.
    • Wait for the trace file to be imported.




Step 7: Analyze the Trace Data

  1. Select Grouping:

    • In the "Select grouping" list, select the domain of the user you are logged into D365FO with. For example, altitudo.com.


  2. SQL Tab:

    • View every SQL statement executed and the method it was called from.
    • Examine the full call stack for each SQL statement.


  3. X++ Tab:

    • View every method used by the application along with its call stack.
    • Analyze data such as the "Count" column, which indicates how many times each method was called.


  4. Call Tree Tab:

    • View all the methods used, displayed in a tree view.
    • The tree view shows the hierarchy and relationship between the methods.


Tips for Using Trace Parser

  • SQL Analysis: Focus on long-running SQL queries to identify performance bottlenecks.
  • Method Call Analysis: Look for frequently called methods as they can indicate hot spots in the application.
  • Call Stack Navigation: Use the call stack information to trace back from the issue to the source method, helping to identify the root cause.
  • Filtering and Grouping: Use filtering and grouping options to narrow down the trace data to relevant parts, making it easier to analyze specific portions of the application's execution.

By following these steps, you can effectively use Trace Parser to debug and optimize your D365FO applications.

No comments:

Post a Comment