Quick Modification for Tracing Bug Code in a Dynamics AX Production Environment

by | Apr 11, 2018 | Development, Dynamics AX

This quick modification for tracing bug code in a Dynamics AX production environment was used at a client site. I have received their permission to blog about this as I thought it was pretty useful.

Basically, the modification consists of the creation of an empty security role. When a user reports a bug, they may be asked for more detailed repro steps within the production environment. The user will be added to this security role, which will trigger the dumping of the X++ call stack into the Infolog when the error is generated. Once the repro is complete, the user is simply removed from the security role, and the logging is stopped. For the bug repro, the user may need to have running code in CIL disabled so the full call stack can be retrieved as well.

Part 1. Create an empty security role in the system

  • Navigate in the Dynamics AX 2012 client System administration > Setup > Security > Security roles
  • Click the New button
  • Fill in pertinent information

Create an empty security role in the system

  • Click the Close button

Part 2. Modify the info class, add() method

Change the method to the following code (no changes in the latter half of the method, so just make the displayed modifications:

NOTE: there is a rough stub for capturing the CIL call stack as well.

Part 3. Add the security role to the user

Within the client, navigate System Administration > Common > Users. Select the user by double-clicking, and add the security role to the user by clicking the Assign roles button

Add the security role to the user

Click the OK button once the debugging role has been selected.

Part 4. If needed, disable running business logic in CIL

In the client, navigate File > Tools > Options > Development tab. Uncheck the Execute business operations in CIL checkbox

Disable running business logic in CIL

Click the Close button.

At this point, you should be able to run a process, and see the call stack in the Infolog when the error is generated.

Error

Once this has been captured, simply go back into the user, and remove the debugging security role from the user. If the Execute business operations in CIL checkbox was modified, go back and correct that setting as well.

I hope that you find this useful, and it provides you something you can add to your ‘bag of tricks’ for debugging or troubleshooting any Dynamics AX issues.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Upcoming Events

february

19feb12:00 pm12:30 pmHarnessing the Potential of Power Apps with Dynamics 365 Customer Engagement (CRM)

27feb11:00 am12:00 pmConfab With Stoneridge - Livestream - Cool Features in Dynamics 365 Business Central

march

04mar12:00 pm12:30 pmPower BI & Reporting with Dynamics 365 Customer Engagement

04mar2:00 pm3:00 pmHow to Incorporate the Power Platform with Dynamics 365 Finance and Supply Chain Management

12mar11:00 am12:00 pmConfab With Stoneridge - Livestream - Power Apps AI Builder

18mar12:00 pm1:00 pmMoving from CRM On Prem to the Cloud – Is it worth It?

18mar2:00 pm3:00 pmThe Past, Present, and Future of Dynamics 365 with Machine Learning and Artificial Intelligence

26mar11:00 am12:00 pmConfab With Stoneridge - Livestream - Portals

About Stoneridge
Stoneridge Software is a unique Microsoft Gold Partner, with emphasis on partner. With specialties in Microsoft Dynamics 365, Microsoft Dynamics AX, Microsoft Dynamics NAV, Microsoft Dynamics GP and Microsoft Dynamics CRM, we focus on attracting the most knowledgeable experts in the field to our team, and prioritize delivering stellar solutions with maximum impact for your business. At Stoneridge, we are deeply committed to your results. Each engagement is met with a dedicated team, ready to provide thorough, tailored, and expert service. Based in Minnesota, we intentionally “step into your shoes,” wherever you are. We focus on what you care about, and develop trusting, long-term relationships with our clients.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X