Open Forum

Expand all | Collapse all

Help with logon macro

  • 1.  Help with logon macro

    Posted 17 days ago
    Hi folks,
    We just completed a GP 2018 R2 upgrade to a new server and to support an old add on, we have a workstation that logs in and out automatically every day.  To login, I am using a macro that I had in the old environment but I can't seem to get it to work.  It opens the application but just sits there and doesn't actually log in.  Sometimes I get a second prompt for credentials but that one bails too.

    Did something change, or is there something wrong with the macro?  Any help is appreciated.

    Logging file 'none.txt'
    CheckActiveWin dictionary 'default' form Login window Login
    TypeTo field 'User ID' , '[myuser]'
    MoveTo field Password
    TypeTo field Password , '[mypassword]'
    CheckActiveWin dictionary 'default' form Login window Login
    MoveTo field 'OK Button'
    ClickHit field 'OK Button'
    NewActiveWin dictionary 'default' form 'Switch Company' window 'Switch Company'
    ClickHit field '(L) Company Names' item 1 # '[MyCompany]'
    MoveTo field 'OK Button'
    ClickHit field 'OK Button'

    ------------------------------
    Karl Pedersen III
    IT Director
    Nye Lubricants, Inc.
    Fairhaven MA
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Help with logon macro

    TOP CONTRIBUTOR
    Posted 16 days ago
    Others might spot the problem by eye, but when in doubt, I record it again. At least to compare the old and new.

    https://support.microsoft.com/en-us/help/856496/how-to-use-macros-and-scheduled-tasks-to-automatically-start-the-progr

    ------------------------------
    David Morinello
    Senior Dynamics GP Systems Architect
    Ascend Learning, LLC
    Leawood KS
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: Help with logon macro

    GPUG ALL STAR
    Posted 15 days ago
    I usually change the CheckActiveWin to ActivateWindow commands

    I also use Logging file nul

    Does that help?

    David




    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: Help with logon macro

    TOP CONTRIBUTOR
    Posted 15 days ago
    Actually in this case the "none.txt" file might give you an important hint as to what is happening. I suspect the user login or the company selection is off just enough to (sneeze) break the Macro.

    ------------------------------
    David Morinello
    Senior Dynamics GP Systems Architect
    Ascend Learning, LLC
    Leawood KS
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 5.  RE: Help with logon macro

    GPUG ALL STAR
    Posted 6 days ago
    Hi @Karl Pedersen III and @David Morinello

    My friend and fellow ISV @Andrew Dean has worked out the problem and asked me to post the solution. As soon as he mentioned it, I went "Doh" because I should have remembered this too.

    For GP 2018 R2 onwards, a change was made to make the password support 21 characters rather than the original 15 characters. To make this work, a local field called '(L) Password21' was added to the appropriate windows and this is used by the code instead. The original Password field was left on the window as well, so this is why there is no error from the macro, other than it does not work.

    Here is the updated macro

    Logging file 'none.txt'
    CheckActiveWin dictionary 'default' form Login window Login
    TypeTo field 'User ID' , '[myuser]'
    MoveTo field '(L) Password21'
    TypeTo field '(L) Password21' , '[mypassword]'
    CheckActiveWin dictionary 'default' form Login window Login
    MoveTo field 'OK Button'
    ClickHit field 'OK Button'
    NewActiveWin dictionary 'default' form 'Switch Company' window 'Switch Company'
    ClickHit field '(L) Company Names' item 1 # '[MyCompany]'
    MoveTo field 'OK Button'
    ClickHit field 'OK Button'
    ​​​
    Thanks Andrew for jogging the memory.

    Regards

    David

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 6.  RE: Help with logon macro

    Posted 4 days ago
    Thank you gentlemen!  I tried all of your suggestions and was still hitting a wall, but I never got to what probably is the key Mr. Musgrave found in his last comment.  Daniel Johnson from Gravoc reached out to me and helped with the Remember User option that was also grayed out.

    To those coming after, I would definitely recommend trying Dave's suggestion, as getting the script to work for one workstation seems like a better move then enabling a security setting I don't love for everyone, but it was taken as a better solution by the admin

    "If your "Remember user and password" option doesn't work, the setting doesn't save, or if the remember user option is always disabled, check these settings to see if one of them might be the problem. By default, the Remember user and password option is not enabled. You have to enable the option at the system level.  Open Tools -> Setup -> System -> System Preferences and check the Enable Remember User option, then click OK to save the setting."

    Karl

    ------------------------------
    Karl Pedersen III
    IT Director
    Nye Lubricants, Inc.
    Fairhaven MA
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role