Track a user activity

pvarpvar Member Posts: 157
edited 2008-01-15 in Navision Attain
Is there any way to track what a user does in Navision or to log all the activity of a user for a specified time period? I know about the change log but I don't think I could acheive what I am looking for with the change log functionality or could I?

Any help would be appreciated. Thanks.

Comments

  • ara3nara3n Member Posts: 9,256
    if you are on sql you can use sql server profiler and see all the sql statement he/she is running.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • WaldoWaldo Member Posts: 3,412
    pvar wrote:
    ... but I don't think I could acheive what I am looking for with the change log functionality or could I?
    Depends on what you're looking for... . Can you tell something more?

    You got:
    - Client Monitor (In NAV)
    - SQL Profiler (SQL Server)
    - Windows Performance Monitor (on local client)
    - Session Monitor (In NAV)
    - Change Log (That you mentioned)
    - User Time Registers (in NAV: Administration / IT Administration / Users / Time Registers)

    And I'm sure I'm forgetting some... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • pvarpvar Member Posts: 157
    We are on a citrix hosting environment. So we don't have access to any of the tools that you mentioned except the change log. We might get some info by looking at the sql logs. But I am looking for some tools within Navision that our auditing people want to monitor.
  • SavatageSavatage Member Posts: 7,142
    pvar wrote:
    tools within Navision that our auditing people want to monitor.

    What specifically do they want to monitor?
    I think if there were tools that fit your needs already built into Nav you would have found themby now :-k
  • pvarpvar Member Posts: 157
    Basically any change to the data(tables). I guess there is no way to know this from Navision. Does any one know of any add on product that we could use for this purpose?
  • WaldoWaldo Member Posts: 3,412
    What exactly is wrong with the Change Log functionality?

    I know that ToIncrease has rewritten the Change Log for their Connectivity Studio. But I think this won't be something you need. They store a "previous version of the record" in a table. Is much overhead and you don't have the user that changed the record ... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • pvarpvar Member Posts: 157
    I didn't say anything wrong with the change log, I just don't know how to use that to get what I am looking for. Let me repeat. I want to know what changes a user makes on Navision data. But I don't want to turn the logging on for all the tables and all the users. I guess you understand my question now.
  • WaldoWaldo Member Posts: 3,412
    I hope I understand it now.

    For logging what data has been changed, you should do it inside NAV, because you need the OnModify, ... triggers. Also, it's necessary that it's logged inside the client where the user is working on.

    And that's exactly what the Change Log does.

    Now, if you don't want it to activate for all users, you could build a hack into the change log functionality. I was thinking of something like:
    1) eliminate the change log setup
    2) in the table "User Setup", add a field "Change Log Activated"
    3) change the Change Log code in codeunit 1 and codeunit 423 to make use of this field (only log if that user is the current user).

    Another possibility is not to hack the default Change Log, but do your own thing with the triggers in codeunit 1 (OnGlobalInsert, OnGlobalModify, ... ).

    Keep in mind (and that also counts for the Change Log functionality) that the global triggers won't be triggered when tables are changed through code. Only when a users is working straight into a table and changing data (e.g. in an item card).

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DriesDries Member Posts: 29
    Hi,

    Good explanation Waldo except that you still can trace all logs also via code and all what you need to do is using the i.e INSERT(TRUE), MODIFY(TRUE), DELETE(TRUE) which means that it will insert a record in a change log because the process that inserts records into change log is under the INSERT, MODIFY and DELETE triggers and it may be also under certain field validation.

    I advice you to use Change log functionalities which I find better than the SQL profiler.

    You don't need to use change log for all tables but you can be more specific for the main table that you need to trace their changes.

    Change log is a nice thing to use.


    Cheers,
    Dries.
  • WaldoWaldo Member Posts: 3,412
    Hm,

    this is what I double checked this morning:
    - activated the Change Log.
    - wrote a codeunit with this code:
    recItem.GET('1000');
    recItem.Description := 'Waldo';
    recItem.MODIFY(TRUE);
    

    Changing data on the item card, it logged like expected. Using the codeunit, it changed the description, but it didn't log in the Change Log, like I expected.

    Yes, it's possible to manually add the code to the triggers to log into the ChangeLog, but depending on the amount of tables you want to log, it can become quite a big job... (and performance overhead!).

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DriesDries Member Posts: 29
    Good morning to you,


    Try this out:

    Declare these variables:

    Name DataType Subtype Length

    OldRrf RecordRef
    NewRrf RecordRef
    ChangeLogMgt Codeunit Change Log Management


    Put this on the OnModify trigger of your table.

    OldRrf.GETTABLE(xRec);
    NwRrf.GETTABLE(Rec);
    MODIFY;
    ChangeLogMgt.LogModification(NwRrf, OldRrf);

    Run again your code.

    Success,
    Dries.
  • WaldoWaldo Member Posts: 3,412
    As I said:
    Waldo wrote:
    Yes, it's possible to manually add the code to the triggers to log into the ChangeLog, but depending on the amount of tables you want to log, it can become quite a big job... (and performance overhead!).
    Your example is a way to do that.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.