Logging User Activity
Jonathan2708
Member Posts: 552
Hi,
Due to a potential security breach, I have been tasked with monitoring the customer records that users are accessing in Navision. I started by creating a table to store the user id, date/time, customer no. etc. Then I added code to the OnAfterGetRecord / OnAfterGetCurrRecord triggers on the customer form to insert a record to log the event, only to find that these 2 triggers do not permit any writing to the database.
Can anybody suggest an alternative method to achieve this? It's Navision 3.7 running against SQL 2000. I've looked at monitoring the SQL server but this doesn't appear useful as the statements are all wrapped in RPC calls.
Any help appreciated,
Jonathan
Due to a potential security breach, I have been tasked with monitoring the customer records that users are accessing in Navision. I started by creating a table to store the user id, date/time, customer no. etc. Then I added code to the OnAfterGetRecord / OnAfterGetCurrRecord triggers on the customer form to insert a record to log the event, only to find that these 2 triggers do not permit any writing to the database.
Can anybody suggest an alternative method to achieve this? It's Navision 3.7 running against SQL 2000. I've looked at monitoring the SQL server but this doesn't appear useful as the statements are all wrapped in RPC calls.
Any help appreciated,
Jonathan
0
Comments
-
There is a granule to use standard logging. The form is General ledger=>Setup=>Change log setup.
If you don't have it, you can put some code in the OnInsert,OnModify,OnDelete,OnRename-triggers of the table. And use rec and xRec to confront the changes in the records.
Remember that these triggers will only be fired if changes happen in the form or in code with e.g. INSERT(TRUE).Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi,
Thanks for the reply. However I'm mainly interested in which records the users have visited, not necessarily changed.
Jonathan0 -
Some idea:
Create a singleinstance codeunit with a temptable in it and a function that gives you the table id and primary key of the table. The function saves it in the temptable of the singleinstance codeunit. Don't save it in the real table because this function must be called from the OnAfterGetCurrentRecord-trigger of the different forms and saving to the table is not allowed.
Put automation "'Navision Timer 1.0'.Timer" (with property WithEvents) in that codeunit and enable it when the function is called the first time.
In the "autTimer::Timer(Milliseconds : Integer)" of the codeunit, check the temptable and if there are records, save them in the real DB and delete them from the temptable.
I didn't test if it works, but I think it can work, because you save the records when OUTSIDE ANY OF THE TRIGGERS in the form(s).
Remember also that you will have LOTS of records in that table.
So you also need a table with a biginteger as primary key and property AutoIncrement=yes. So you don't need to increment the field yourself.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions