Wednesday, January 28, 2015

How to use macros and Scheduled Tasks to automatically start the program and to perform other tasks in Microsoft Dynamics GP

1. To create and to run a macro that automatically generates reports or that performs other tasks, follow these steps:a.  Start Microsoft Dynamics GP. Do not log on.
b.  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
c.  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.
d.  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.

e.  In the Password field, type the password for the user who is selected in step 1d.
f.  Click OK. The Company Login dialog box opens.
g.  From the Company list, click the company for which you want to log on, and then click OK.

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.
h.  Complete all the steps that are required to process the reports or other tasks within this company.
i.  On the File menu, click Exit to close Microsoft Dynamics GP.

2. 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.
3. To start Microsoft Dynamics GP by using the macro, create a batch file. To do this, follow these steps:a.  Create a file that has a .bat file name extension. For example, create a file that is named DynamicsGP.bat.
b.  Use a text editor, such as Notepad, to open the batch file.
c.  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
d.  Save the changes, and then close the batch file.

No comments:

Post a Comment