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:
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:
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/
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/
Comments
Existe alguna posibilidad de incluir en la macro cual es el proceso que debe seguir si se abre la ventana de escasez y que de esta manera no se interrumpa el proceso de carga de los datos de la macro.
Espero poder contar con su ayuda.
Saludos,
RM
if yes please tell me the way how we can record please
Thanks,
-Dan
For GP2010 you will need to make a few changes.
The second line in your macro will need to be something like this:
Logging file none
The last line in your macro file will need to be something like this:
MenuSelect title File entry Exit
MG.-