(Please note, this article refers to Dynamics GP 2010. For more updated information and tutorials for Dynamics GP, please contact us.)
This article discusses how to create and how to run macros to perform various tasks in Microsoft Dynamics GP. The macros can be used to automatically start the program, to generate reports, and to perform other tasks. This article also discusses how to use Scheduled Tasks to run the macros.
To create and to run a macro that automatically generates reports or that performs other tasks, follow these steps:
- Start Microsoft Dynamics GP. Do not log on.
- In the Welcome to Microsoft Dynamics GP dialog box, press ALT+F8 to start recording the logon macro. Name the macro, and then save it to the installation folder for Microsoft Dynamics GP.
Note If the macro is not in the installation folder, you will receive the following error message: Cannot open macro. In the Server box, click a server.
Note It is important to select the appropriate server when you create the macro, even if the correct server was selected when you started Microsoft Dynamics GP.
- In the User ID field, enter the appropriate information for the user who will generate the report or who will generate other tasks.
Notes: It is important to do this step when you create the macro, even if the correct user ID is displayed when you start Microsoft Dynamics GP.To make sure that the desired user ID is recorded within the macro, we recommended that you delete any existing user ID from the field, move to the Password field, return to the User ID field, and then enter the desired ID.
- In the Password field, type the password for the user who is selected in step 1d.
- Click OK. The Company Login dialog box opens.
- From the Company list, click the company for which you want to log on, and then clickOK.
Note: It is important to select the appropriate company when you create the macro, even if the correct company is selected when the Company Login window opens.
- Complete all the steps that are required to process the reports or other tasks within this company.
- On the File menu, click Exit to close Microsoft Dynamics GP.
- Use a text editor, such as Notepad, to add the following line as the second line of the macro. Logging file ‘macro.log’. Note This line prevents any message that is displayed by the macro from being displayed. Therefore, such a message cannot prevent a logon to Microsoft Dynamics GP. An example of such a message is the total run time of the macro. All messages that are generated by the macro are written to the Macro.log file.
- To start Microsoft Dynamics GP by using the macro, create a batch file. To do this, follow these steps:
- Use a text editor, such as Notepad, to open the batch file.
- Paste the following line into the .bat file. dynamics dynamics.set XXX.mac cd c:\Dynamics GP installation path
Note Replace XXX.mac with the name of the macro file that you assigned in Step 1b. Replace Dynamics GP installation path with the installation path of Microsoft Dynamics GP on this computer. For example, type the following path: Program Files\Microsoft Dynamics\GP Save the changes, and then close the batch file.
- Configure Scheduled Tasks to run the batch file that will run the macro that you created. For more information about how to use Scheduled Tasks, see the Windows manuals or Windows online documentation.Create a file that has a .bat file name extension. For example, create a file that is named DynamicsGP.bat.
This is just one example of how you can setup and use macros to automate routine tasks in GP. For more information on Dynamics GP, please feel free to contact us or explore the Learning section of our site!