The Theory Part
Typically, while a process is executing in Microsoft Dynamics GP a user attempting to close the application would receive the following message:
|Process are being run message|
However, Microsoft Dynamics GP can cause a Visual Studio Tools customization to abruptly shut-down if a user closes the application deliberately or accidentally. Microsoft Dexterity developers have never had to worry about this since Dexterity processes are managed by the call stack.
A call stack is an internal Dexterity mechanism that manages the processing of scripts. Dexterity has eight call stacks; seven are used for foreground processing while the other is used for background processing. When the scripts on a particular call stack have finished processing, the call stack is available to be used again. Scripts in the call stack can be viewed in Process Monitor whether they are foreground, background, or remote processes.
|Process(es) in call stack while running a Trial Balance report|
In some instances and depending on the type of process, a Dexterity developer have the ability to mark such a process as removable from the call stack, in which case the end-user can take advantage of the Process Monitor window to delete the process from the call stack.
In order for a Visual Studio Tools add-in to protect itself from termination by the Microsoft Dynamics GP application while processes are being executed, you can add the following lines of code before and after the process to be executed.
Hopefully you have found this article useful.
Special thanks to Patrick Roth with the Escalation Engineering team in Fargo for posting the response on the partner forum.
Until next post!
Mariano Gomez, MVP
Intelligent Partnerships, LLC