Macros in Microsoft Dynamics GP v 10.0

Yesterday, I was asked why macros that seemed pretty straight forward and worked well in previous releases of Microsoft Dynamics GP, all in a sudden, seem not to work in Dynamics GP 10. Case in particular, a macro was previously written to automate the checklinks of the Sales Work table group and automatically close the application after completing the operation, but now seemed to hung when attempting to close.

After running a few tests, as I suspected, the reason Microsoft Dynamics GP is not quiting is 3-fold:

1) The Navigation Pane feature is an internal Dexterity window. When control is returned from the check links process, the focus is immediately returned to the navigation pane, not the work area form (BuiLtin form), causing the macro command to fail.

To fix this, the navigation pane needs to be disabled first when the macro begins its execution:


CommandExec dictionary 'default' form 'Command_System' command NavigationPane

2) Macros and Progress Windows are enemies. This one is not new, however, it is a common occurrence since macros attempt to restore the focus to the progress window itself once the progress field vanishes (when it reaches 100%).

3) Report output to screen is also a point of failure for macros. The macro will need to bypass the screen output to a file if possible, since the Report output screen is an internal Dexterity window.

Saving to a file (appending always) will avoid trying to close the screen output window, hence cancelling interaction with the internal Dexterity form.

The following is the complete macro code:


# DEXVERSION=10.0.193.0 2 2
CommandExec dictionary 'default' form 'Command_System' command NavigationPane
CommandExec dictionary 'default' form 'Command_System' command 'SY_Check_Links'
NewActiveWin dictionary 'default' form 'SY_Check_Links' window 'Check Links'
ClickHit field 'File Series' item 2 # 'Sales'
MoveTo field Source item 0
ClickHit field Source item 19 # 'Sales Work'
MoveTo field 'Insert>> Button I'
ClickHit field 'Insert>> Button I'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form 'Report_Destination' window 'Report_Destination'
MoveTo field 'Print to File' # 'FALSE'
ClickHit field 'Print to File' # 'TRUE'
MoveTo field 'File Export Name'
TypeTo field 'File Export Name' , 'test.txt'
MoveTo field 'Export File Type' item 0
ClickHit field 'Export File Type' item 1 # 'Text file'

MoveTo field 'OK Button'
ClickHit field 'OK Button'
# NewActiveWin dictionary 'default' form sheLL window sheLL
# ActivateWindow dictionary 'default' form 'Progress_Control' window 'Progress_Window'
# NewActiveWin dictionary 'default' form sheLL window sheLL
# Print To File: 'File Maintenance Error Report'
CommandExec form BuiLtin command cmdQuitApplication

Highlighted in red are the key aspects that need to occur in the macro to bypass any user interaction and for the macro to be successful in its execution; note the exclusion of the Progress_Control window. Highlighted in orange is the bypass of the screen output in favor of a less interactive file export.

Hope this helps all of you who are trying to figure out this new Dynamics GP 10 user interface.

Please drop your comments about this article.

MG.-
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/

Advertisements

One Response to Macros in Microsoft Dynamics GP v 10.0

  1. Anonymous says:

    I am trying to run a batch file from the Navigation menu. Placing the Integration Group that I want to run is not working correctly. So I placed the Integration Group in a batch file and recorded the macro to click the Batch file. However, the macro is recording the integration steps. I don’t want this. I would like to record all steps necessary to click the shortcut and let the batch file takeover from there. Any suggestions. Thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: