GP Power Tools has very powerful and flexible Automatic Logout functionality to gracefully log idle users out of Microsoft Dynamics GP. However, this feature requires the user to be idle for a specified period before it will attempt to logout.
As an Administrator there are times where you would like users to exit Microsoft Dynamics GP immediately and don’t want to wait for Automatic Logout to activate. The sample project in this article makes this possible.
The project uses a timed background process to check a flag stored in the User Company Access (SY_User_Company_Access_REL) table every minute. If this flag has been set, the background process will issue a call to the MBS_Exit_After_Processes Helper Function. This is the same code that is used by the Automatic Logout feature, but is now called within a minute of the flag being set.
[Edit] The example has been updated to use the Automatic Logout settings if they are enabled, so it can use the Smart Options, such as automatically saving windows, as well as the 1 minute Automatic Logout warning dialog.
Controlling the setting of the flag is performed from the User Activity window. Added to the Additional Menu are options to set and clear the Automatic Logout request for the selected user/company session or for all users and companies currently logged in.
Note: The current session cannot be requested to Automatically Logout individually and will not be included when selecting all users and companies.
Below is a screenshot of the Project Setup window for the AUTO_LOGOUT_REMOTE project:
Here is a summary of the components of the project:
Triggers AUTO_LOGOUT_REMOTE_01 to AUTO_LOGOUT_REMOTE_04
These Form Menu triggers will set or clear the Automatic Logout requests for either individual sessions or all sessions.
Trigger AUTO_LOGOUT_REMOTE_05
This Form Menu Trigger will display whether the selected users and company session has been requested for Automatic Logout.
Trigger AUTO_LOGOUT_REMOTE_06
This is the timed process which checks the request flag every minute and will initiate the Automatic Logout if the current session has been selected. It calls the Runtime Execute Script AUTO_LOGOUT_REMOTE_06 to handle the exit.
Trigger AUTO_LOGOUT_REMOTE_07 & AUTO_LOGOUT_REMOTE_08
These triggers clear the request flag on Login and Logout to avoid the request flag remaining set from a previous session.
Runtime Execute Script AUTO_LOGOUT_REMOTE_06
This script is called by the Trigger AUTO_LOGOUT_REMOTE_06 and performs the actual logout process. It will use Automatic Logout settings if enabled (with smart options and optional dialog), otherwise it will just request the exit after processes.
Messages AUTO_LOGOUT_REMOTE_01 to AUTO_LOGOUT_REMOTE_04
These messages contain the wording for the dialogs displayed to users. They can be edited or translated as desired.
Downloading and Installing
[Edit] An issue has been discovered where the background timed process for this project can stop Automatic Logout from working. This is fixed in the GP Power Tools build 30.2.
Download the example code, import using the Project Setup window (now possible for first time imports with Build 28.8 onwards), or use Configuration Export/Import window (for older builds):
The code will be active on next login or after switching companies, or you can use start the triggers manually from the Project Setup window.
More Information
For more information see:
- #GPPT Automatic Logout for Microsoft Dynamics GP
- #GPPT Why does Automatic Logout fail to work?
- #GPPT Why Does The Report Writer Screen Close Automatically?
- #GPPT Automatic Logout Not Identifying Activity and Logging Out
- #GPPT Closing External Applications with Automatic Logout
- #GPPT Remotely requesting immediate Automatic Logout
- GP Power Tools Portal: http://winthropdc.com/GPPT
- GP Power Tools Samples: http://winthropdc.com/GPPT/Samples
- GP Power Tools Videos: http://winthropdc.com/GPPT/Videos
Hope you like this example.
David
14-Feb-2024: Added note about compatibility issue with Automatic Logout. This is fixed in build 30.2.
22-Mar-2024: Updated to use Automatic Logout settings if they are enabled.
This article was originally posted on http://www.winthropdc.com/blog.
6 thoughts on “#GPPT Remotely requesting immediate Automatic Logout”