MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer
Lab 1: Work with trace and import it into the Trace Parser tool
Change Record
Version | Date | Change |
---|---|---|
1.0 | 23 Aug 2024 | Initial release |
Objective
This lab consists of three exercises. Requirements include a working development virtual machine (VM) with access to finance and operations apps, the Trace Parser tool, and SQL Server Management Studio (SSMS). For the lab:
-
In the first exercise, you’ll record a performance issue scenario with the Task recorder tool.
-
In the second exercise, you’ll import the downloaded file from Task recorder into Trace Parser.
-
In the last exercise, you’ll analyze records in Trace Parser.
Prerequisites
To prepare for the exercises:
-
Select Windows and search for and open Trace Parser.
-
Enter a dot (.) in Server name, and then enter TraceDB in Select or enter a database name.
-
Select Register and Yes to create the database, and then select Capture Events.
-
Verify Microsoft-Dynamics-AX-XppExecutionTraces and Microsoft-Dynamics-AX-ExecutionTraces events exist in the top three rows. If they do not exist, you must activate them. If they do, close Trace Parser and proceed to Exercise 1.
-
Open File Explorer and navigate to C:\AOSService\webroot\Monitoring.
-
Right-click DynamicsAXExecutionTraces.man to open the context menu, and then select Open with.
-
Select Try an app on this PC, and then select Notepad and select OK.
-
Select Edit and Replace, and then enter %APPROOT% in Find what.
-
Enter C:\AOSService\webroot in Replace with:
-
Select Replace All, select Cancel, close Notepad, and then select Save.
-
Right-click DynamicsAXXppExecutionTraces.man to open the context menu, and then select Open with.
-
Select Notepad, clear Always use this app to open .man files, and then select OK.
-
Select Edit and Replace, and then enter %APPROOT% in Find what.
-
Enter C:\AOSService\webroot in Replace with.
-
Select Replace All, select Cancel, close Notepad, and then select Save.
-
Open Windows PowerShell as Admin, and then enter each of the following, selecting Enter after each entry:
- wevtutil um "C:\\AOSService\\webroot\\Monitoring\\DynamicsAXExecutionTraces.man"
- wevtutil um "C:\\AOSService\\webroot\\Monitoring\\DynamicsAXXppExecutionTraces.man"
- wevtutil im "C:\\AOSService\\webroot\\Monitoring\\DynamicsAXExecutionTraces.man"
- wevtutil im "C:\\AOSService\\webroot\\Monitoring\\DynamicsAXXppExecutionTraces.man"
-
Close Trace Parser.
-
Select Windows, and search for and open Trace Parser.
-
Select Capture Events, and then verify Microsoft-Dynamics-AX-XppExecutionTraces and Microsoft-Dynamics-AX-ExecutionTraces events exist in the top three rows
If the events exist, the Trace is working. Close Trace Parser.
Exercise 1: Create a trace using Task recorder
To create a trace using the Task recorder tool:
-
Open Microsoft Edge in your VM.
-
Go to Dashboard – Finance and Operations (dynamics.com) and sign in to the finance and operations apps with your account.
-
Select the question mark on the upper-right of the Edge window, and then select Trace
-
Enter the following when the Tracing dialog opens, and then select Start trace:
-
Trace name: MB500Trace
-
Include SQL parameter values: Yes
-
-
Notice that the trace is running, and leave the window open Users have reported that sales orders are working slowly, so you’ll need to review the sales order lines and check reservations against on-hand supply.
-
In the Navigation pane, select Modules, and then select Accounts receivable.
-
In the menu for Accounts receivable, select the Orders menu, and then select All sales orders
-
Select the last sales order in the list and the lines will open
-
In Sales order details, select Inventory in the (lower) Action pane for sales order lines.
-
Select Reservation to check the reservation against on-hand supply.
-
Stop the trace by selecting Stop trace.
-
Download or upload the trace after it stops. Uploading a trace saves it in finance and operations apps, from which you then can download it repeatedly.
Important: If you download a trace without uploading it first, the trace is deleted. -
Select Download trace, and the trace is stored in the Downloads folder on the VM.
Exercise 2: Import the downloaded trace into Trace Parser
To import a trace you’ve downloaded into the Trace Parser tool:
-
Select Start in your VM and then enter Trace in the search field
-
Select the Microsoft Dynamics 365 Unified Operations – Trace Parser.
If this is your first time using the Trace Parser tool, no database is registered, so you’ll receive a prompt to create one:
-
Enter the following to create a database on the local VM:
-
Server name: . (type in a dot for local server)
-
Select or enter a database name: D365Trace
-
-
Select Register to create the database for the trace file.
-
If the database name doesn’t exist in SQL Server, a prompt will appear with the message “The specific database does not exist. Would you like to create it?”
-
Select Yes to create the database.
-
-
Select Import Trace and navigate to the trace file (Downloads folder), and then select it.
-
Select Open to import the file:
The import process will take a few minutes.
Exercise 3: Analyze in Trace Parser
To analyze X++ and SQL for users in the Trace Parser tool:
-
Select the Select Grouping option, and then select your applicable user account. The trace parser will filter for your specific user.
-
Select Call Tree to see the call stack, and then move down to find the reddest color.
-
Expand the tree node for the reddest color (the largest number of ms) and continue until all nodes are expanded, and make sure you’re watching the Context field to see the X++ code
-
Select X++ next to Call tree, and then select the Total Inclusive (ms) column to sort the most expensive in descending order.
-
Find the first row with Code to see the most expensive code, and then select SQL next to X++.
-
Select Show Tables, and then enter SalesTable in Name Filter. Only SQL statements visible on SalesTable should be listed.
-
Enter InventTrans in Name Filter and Show Tables. Only SQL statement in InventTrans should now be listed in the view
-
Select Jump to Call Tree (lower right between the Call Stack and Code) and wait. Trace Parser goes to Call Tree, and you can see the call stack.