- Have a Dynamics GP macro that automatically logs into GP, runs a task and then closes GP.
- We have a scheduled job inside SQL Server Agent that runs a command similar to the one below.
-
"C:\Program Files (x86)\Microsoft Dynamics\GP2013\Dynamics.exe" "C:\Program Files (x86)\Microsoft Dynamics\GP2013\Dynamics.set" "C:\Macros\GPMacro.mac"
-
- This macro functions without issue in a Windows 2008 R2/SQL 2008 R2/GP 2013 R2 environment.
- When the same macro retrofitted for GP 2016/Windows 2016/SQL 2016 Server environment, it fails because it does not see the GP Logon Window as the active window (see Macro Log Results below).
- The Macro does run if logged onto the Windows Desktop and then GPMacro.bat file, so do not believe the issue is a syntax issue.
Wondering if there are any special settings or other macro commands that can be inserted to help resolve matters?
Macro Log Results
===============================================================================
:C:Macros/GPMacro.mac Started 06/13/2018 15:36:05
:C:Macros/GPMacro.mac Aborted 06/13/2018 15:36:05
:C:Macros/GPMacro.mac Elapsed 0:05 Last Line 3
Error: Field on window is inactive or disabled.
Last Line: 3
Line: MoveTo field 'User ID'
Location: dictionary 'Microsoft Dynamics GP' form Login window Login field
Window Contents:
'User ID': "GPUSERID"
Password: "XXXXXXXX"
D:'(L) RememberMe': "FALSE"
'(L) SQL_DataSource': "1"
Dynamics GP 2016 =
L:'(L) AuthenticationType': "1"
Directory Account
SQL Server Account =
'OK Button': Button
'Cancel Button': Button
L:LoginPicture: "1"
L:'(L) Status': "Version : 16.00.0675"
WindowHelp: Button
Front Window:
'User ID': "GPUSERID"
Password: "XXXXXXXX"
D:'(L) RememberMe': "FALSE"
'(L) SQL_DataSource': "1"
Dynamics GP 2016 =
L:'(L) AuthenticationType': "1"
Directory Account
SQL Server Account =
'OK Button': Button
'Cancel Button': Button
L:LoginPicture: "1"
L:'(L) Status': "Version : 16.00.0675"
WindowHelp: Button
Sample Macro that logs into GP and then out.
Logging file 'c:\macros\macro.log'
CheckActiveWin dictionary 'default' form Login window Login
MoveTo field 'User ID'
TypeTo field 'User ID' , 'GPUSERID'
MoveTo field Password
TypeTo field Password , 'GPUSER Password'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form sheLL window sheLL
NewActiveWin dictionary 'default' form 'Switch Company' window 'Switch Company'
ClickHit field '(L) Company Names' item 1
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form sheLL window sheLL
ActivateWindow dictionary 'default' form sheLL window sheLL
CommandExec dictionary 'default' form 'Command_System' command CloseAllWindows
NewActiveWin dictionary 'default' form sheLL window sheLL
CommandExec form BuiLtin command cmdQuitApplication
*This post is locked for comments