#GPPT Why does Automatic Logout fail to work?

David Meego - Click for blog homepageBuild 26 of GP Power Tools introduced a new Automatic Logout feature for Microsoft Dynamics GP. This functionality was further enhanced in Build 27 and again in the upcoming Build 28 release.

While there are other solutions which can log out inactive users, the implementation in GP Power Tools has many enhancements and features not available in other offerings.

However, there are also times when Automatic Logout has been reported not to work. Read on to understand what is happening….

We should start by explaining how the feature works so you can see what it offers in comparison to other third party solutions.

Note: The screenshots in this article are from the upcoming Build 28 release of GP Power Tools and includes features not available in the earlier builds. Consider this a sneak peek.

How Automatic Logout works

The Automatic Logout feature is configured from the Options Tab of the Administrator Settings window in the User Activity Settings section:

It is not actually possible to track inactivity in Microsoft Dynamics GP, so instead we track activity by keeping a last activity date and time which is updated by a number of common activities in Dynamics GP.

Automatic Logout is enabled to take effect after a specified number of minutes (default is 60 minutes) and will take effect for all users and companies. However, by clicking the User Selection button it is possible to include or exclude on a per user and/or company basis. Build 28 also allows inclusion based on User Class, Security Modified Alternate ID, Security Roles and Security Tasks.

There is also an option to get more aggressive with the logout time if your available user count gets below a specified percentage (default is 10% and 30 minutes).

Using a timed background process which is executed every minute, we can check when the last activity was and take further action when needed. You can view this process by selecting Microsoft Dynamics GP >> Process Monitor from the menus and changing to the Timed queue.

Once the minutes from the last activity record reaches one minute less than the limit, a dialog will open and count down the last minute.

The dialog can be disabled for all or for selected users. This can be handy if users are always cancelling the dialog to stop the Automatic Logout. If they were actually using Dynamics GP the dialog would never appear. If User Activity Tracking has been enabled, you will also be able to see how many times a user has cancelled the dialog using the User Activity Log window; look at the Auto Dialog column.

The dialog will attempt to bring itself to the front of any open windows and will cause the Dynamics GP icon on the start bar to flash (there is an option to disable this behaviour if desired).

Once the final minute has counted down (or the Exit Now button is clicked), GP Power Tools will start the Automatic Logout.

What Automatic Logout does

Depending on the options selected on the Administrator Settings window, once the Automatic Logout starts the following actions will occur:

  • Any open windows will be closed (in the reverse order of how they were opened).
  • If the window has unsaved data and has a Save button or OK button and all required fields have been entered, the button will be clicked before attempting to close the window.
  • If the window is an Inquiry window it will be cleared and closed. (New to Build 28).
  • The record in the ACTIVITY table for the session will be removed to free up the user license. (New to Build 28).
  • Finally, a close window command is issued to close any remaining windows missed by the steps above.

If all the windows are closed, GP Power Tools will issue an Exit After Processes instruction. This is a GP Power Tools feature which will allow any background processes to complete before exiting.

Note that the exit is ALWAYS a graceful exit and it will never interrupt background processes, leave orphaned records or cause data corruption.

On the rare occasion that there is a window with data which needs saving, but does not have all the required fields or has another issue which opens a modal system dialog, the exit will fail to complete.

If User Activity Tracking is enabled, the Auto Count, Auto Date and Auto Time columns will show how many times the Automatic Logout has started and the date and time of the last attempt. The Auto Exit column will show how many times the Automatic Logout succeeded. If you have a high count value with a low exit value, then you might find the user is actively doing something to prevent Automatic Logout from working. This is why the new features were added in Build 28.

Why does Automatic Logout fail to work?

Let me now explain why Automatic Logout might fail to work on a system. This article is the result of a couple of recent support cases.

Please review the following steps if you believe that Automatic Logout is not working:

  1. Make sure GP Power Tools is installed on ALL workstations and servers. GP Power Tools should be installed everywhere the Dynamics GP application is installed. How can the code work if it is not installed? This is a requirement for almost all features of GP Power Tools.
  2. Make sure GP Power Tools is registered for Administrator Tools and log back in. It needs to be registered at login for the functionality to activate.
  3. Look at the Timed Queue in the Process Monitor to confirm that the background process is there. If not, the feature is not enabled or the user is exempted.
  4. Make sure the Check for SQL activity option on Administrator Settings window is NOT selected. This option can prevent a logout if another background process reads or writes to the SQL Server.
  5. Test to see if any of the other processes in the Timed queue of the Process Monitor window reset the last activity time. Make a note of the Last Activity minutes shown on the Auto Logout process. For each of the other processes in turn, select it and click the Run Now button, then select Auto Logout and click Run Now and see if the Last Activity resets back to 0. If it does reset back to 0, please open a support request so we can investigate which product is causing the issue.
  6. If running on a Terminal Server (or Citrix Server) and you are using a timeout feature on the server, make sure that the Automatic Logout time set for GP Power Tools is less than the timeout feature by at least 30-60 minutes. If the Terminal Server kills the Dynamics GP process, not only will the Automatic Logout not be able to work, but you risk serious data corruption.
  7. If a session cannot be exited gracefully because a dialog requiring user interaction has been displayed when attempting to close all windows, the system will not exit. This includes the dialog to change the user date which opens at midnight (This dialog can be disabled with the SuppressChangeDateDialog Dex.ini setting).
  8. If background processing has been paused (manually, or due to a report waiting to process while the previous report is still being displayed to screen), the background process used to check if Automatic Logout should be activated will be waiting in the queue.

The two support cases raised were resolved by point 1 and point 5 in the list above.

I hope this information was helpful.


21-May-2020: Added seventh reason, for Automatic Logout to fail due to not being able to close all windows.

23-May-2020: Added eighth reason, for the background process queue is held up, preventing the Automatic Logout check from running.

16-Apr-2021: Added additional reason, to ensure that the Administrator Tools is registered at login.

This article was originally posted on http://www.winthropdc.com/blog.

4 thoughts on “#GPPT Why does Automatic Logout fail to work?

Please post feedback or comments

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.