One very common request by users and organizations using Microsoft Dynamics GP and Integration Manager is the ability to schedule an integration to run overnight. For small companies this can become a challenge, more so, when they lack the technical resources on staff or the basics on the Dynamics GP architecture.
Any of the approaches used to schedule the integration will start from the same point: creating a login macro. The steps to create a login macro are widely documented in the Integration Manager Users Guide printable manual, in Chapter 17, under the section Recording the Login Macro, hence will not be the focus of this article. However, here is a sample of what the macro file (conveniently named LOGIN.MAC) should look like.
NOTE: Your macro must close all windows opened upon startup of Dynamics GP for Integration Manager to proceed successfully. In addition, you will manually need to edit the file to include the line in red above to prevent displaying any message generated by the macro execution.
Macros and running Integration Manager from inside Dynamics GP
The macro system has a limitation when it comes to executing integrations from within the Dynamics GP application: macros cannot interact with Win32 applications menus and options. Hence, if you attempt to use the Run Integration menu option found under Microsoft Dynamics GP > Tools > Integrate > Run Integration, and while GP will launch the Microsoft.Dynamics.GP.IntegrationManager.IMRun.exe application (IMRUN for a short), the macro system will not be able to record the extra click on the integration you want to execute after the IMRUN application is launched.
*Click on image to enlarge
However, there is a workaround! The macro system can interact with the Dynamics GP Shortcut Navigation Bar. If you add a shortcut to the Dynamics GP Navigation Bar to include the IMRun application with the integration to be executed as a parameter, your macro can record the action when you click on the shortcut.
* Click on image to enlarge
Scheduling the Integration
I have worked with clients solving the issue of scheduling without resorting to add-ons or complex scheduling applications.
Batch Files and Windows Task Scheduler
Batch files can still prove very useful, even in today’s GUI-based world. The batch file technique will require executing Dynamics GP with the log in macro as a parameter to the launching process. In addition, the login macro must contain additional actions to run the integration from the Navigation Bar, as previously described.
The following is a sample batch file named IMEXEC.BAT
Once the batch has been created, we can use Microsoft Windows Task Scheduler to complete the scheduling process. The following Microsoft Knowledgebase and TechNet articles will help with scheduling the batch file based on your operating system:
I will address running integrations as separate tasks in a future installment. This will allow for discussion of more advance scheduling techniques.
Windows Networking – Working with the Windows Server 2008 Task Scheduler (Part 1).
Windows Networking – Working with the Windows Server 2008 Task Scheduler (Part 2).
Dynamics GP Blogster- Macros in Micrsoft Dynamics GP v 10.0. Click here.
Until next post!
Mariano Gomez, MIS, PMP
Maximum Global Business, LLC