This is the second in a series of articles that are designed to help you understand how the Support Debugging Tool works and how you can leverage its different features. In the past, I have described features without explaining how these features can be used and what the differences between different modes is. With this series I hope to remedy that situation.
In the previous article, we discussed the different Logging Modes of the Support Debugging Tool. In this article we will discuss the various methods of controlling Manual Logging Mode. If you missed the first article, please have a read: Understanding Support Debugging Tool Logging Modes.
Manual Logging Mode
Manual Logging Mode allows us to capture up to 5 different log types from when the logging is started until it is stopped. In the sections below we will discuss five different ways to control Manual Logging Mode:
Manual Start and Stop
Manual Logging Mode can be manually started by the user interface. As mentioned in the previous article it can be started in the following ways:
Application Level Tools Menu
Window Level Tools Menu
As the controls are available from every window's Tools menu, you don't have to go back to the main Support Debugging Tool window or the Application level menus.
Automatic Start at launch
If you need to capture the events after launching Microsoft Dynamics GP, but before you have logged in, you will not be able to do this using one of the Manual Start methods above because you cannot access the main Support Debugging Tool window or Tools menus until after login.
To provide this functionality, the Support Debugging Tool has a Dex.ini setting which can be enabled via the Dex.ini Setting window (available from the Options button menu or the Debugger menu on the main Support Debugging Tool window) or by manually editing the Dex.ini file to add the setting MBS_Debug_LogOnStartup=TRUE.
Dex.ini Settings window
Note: If you wish to have this method enabled continuously, you can use the Dex.ini Configuration window to add the MBS_Debug_LogOnStartup=TRUE Dex.ini setting back after each login.
Automatic Start at login
If you would like Manual Logging Mode to start automatically after logging into Microsoft Dynamics GP, you can achieve this by using an Automatic Debugger Mode trigger. Select Options >> Setup Automatic Debugger Mode from the Support Debugging Tool main window.
The trigger must be defined with no Trigger Type selected, marked to Start Trigger Automatically on Login and have the Logging Types you want selected on the Options Tab.
Setup Automatic Debugger Mode window
Automated Start and Stop
If you would like to turn on Manual Logging Mode automatically for specific events in the application you can use two Non-Logging Automatic Debugger Mode triggers to automatically start and stop Manual Logging Mode.
For example: You want Manual Logging Mode running only while a particular form or window is open, when a particular field change script is running or when a particular procedure or function is being executed.
To achieve this you just need to create a trigger for the start event and use the conditional script to call the MBS_Logging_Start helper function.
Start trigger Resource settings
Start trigger script using helper function
Then create another trigger for the end event and user the conditional script to call the MBS_Logging_Stop helper function.
Stop trigger Resource settings
Stop trigger script using helper function
The Debugger Settings XML file for the SOP_Entry automated start and stop example are attached as an archive at the bottom of this article.
Note: If this method is used on a procedure which in turn calls a SQL Stored Procedure (known as a prototype procedure) and SQL Profile Tracing is enabled, you can capture a trace specifically targetted at a single SQL Stored Procedure.
Manual Start with different Logging Types
If you want to start Manual Logging Mode using different Logging Types to those defined in the Administrator Settings window, you can use the Automatic Debugger Mode DEFAULT trigger. Just leave the Trigger Type unselected and set the Logging Types as desired on the Options tab.
Setup Automatic Debugger Mode window
Then manually start Automatic Debugger Mode from the main Support Debugging Tool window using Turn On Automatic Debugger Mode >> DEFAULT only. This will start Automatic Debugger Mode with no triggers which then drops back to Manual Logging Mode. Turning off Manual Logging Mode works as normal.
Support Debugging Tool main window
As you can see, there are many options for controlling Manual Logging Mode.... the choice of which to use is all yours.
Posting from Ian Grieve at Azurecurve
Posting from Mark Polino at DynamicAccounting.net
Great article on manual logging using SDT. Very helpful.
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.