Killing a user session
In Microsoft Dynamics NAV 2013, user sessions are controlled by client services. The NAV administration client provides plenty of options to manage user sessions; however, some time is needed to kill a particular session. With the help of this recipe, we will add a small code on the NAV standard session page to kill the session.
How to do it…
To start, open Object Designer and open page 9506, Session List in the design mode.
To edit actions, navigate to View | Page Actions (Ctrl + Alt + F4).
Under the action group Session, add a new action with name
Kill Session
.Set the following properties for the
Kill Session
action:Property
Value
Image
Delete
Promoted
Yes
PromotedCategory
Category4
PromotedIsBig
Yes
Let's add the following code to the
OnAction
trigger of theKill Session
action.IF CONFIRM ('Are you sure?') THEN STOPSESSION("Session ID")
It's time to save and close the page.
How it works...
As NAV provides a standard page for active sessions...