How to capture Login and Logout Time in navision 2017??

raja123
Member Posts: 50
I tried to get the login time by adding C/al code in codeunit (1)ApplicationManagement -> CompanyOpen()

but i cant replicate the same in CompanyClose() to get logout time.
Any suggestions will be helpful.

but i cant replicate the same in CompanyClose() to get logout time.
Any suggestions will be helpful.

0
Answers
-
Hi,
There is table 2000000111 "Session Event" where this information is already being saved.0 -
Hi AlexDen ,
I created a event subscriber in codeunit and i'm trying to get the login and logout time after the record inserted in the 'session event' table
Here LoginLogout is my custom table and i want to capture time details in this table .
But its not working.
0 -
Raja, if I were you I would use events OnAfterCompanyOpen() and OnAfterCompanyClose() events from 1st codeunit to save this info.
And the code should be like that:
OnAfterCompanyOpen():IF NOT ActiveSession.GET(SERVICEINSTANCEID,SESSIONID) THEN EXIT; LoginLogOut.INIT; LoginLogOut."Session Unique ID" := ActiveSession."Session Unique ID"; // It's primary key LoginLogOut."Session ID" := SESSIONID; LoginLogOut."User ID" := USERID; LoginLogOut."Login Time" := CURRENTDATETIME; LoginLogOut.INSERT;
OnAfterCompanyClose():IF ActiveSession.GET(SERVICEINSTANCEID,SESSIONID) THEN IF LoginLogOut.GET(ActiveSession."Session Unique ID") THEN BEGIN LoginLogOut."Logout Time" := CURRENTDATETIME; LoginLogOut.MODIFY; END;
0 -
Hi AlexDen i tried what you mentioned (subscribe to those events)
but getting this error while opening a client
0 -
hi Alex,
onAftercompanyClose() is not executing.But OnafterCompanyOpen() is working.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions