web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Auditing for SL

(0) ShareShare
ReportReport
Posted on by 1,348

Hi

Does anyone know if there is a way to track users and the last log on date in Dynamics SL?  If not, has anyone use or is aware of any add-on for SL that has that functionality?

Thanks for any response.

Regards

Lisa

*This post is locked for comments

I have the same question (0)
  • DelmerJohnson Profile Picture
    29 on at
    RE: Auditing for SL

    I know this question is from 2015, but it shows up in searches for Dynamics SL Auditing, so I thought it was appropriate to reply. Since the question was asked and answered SteadyCode has developed an add-on named SteadyAudit that does this. Several companies are using it and auditing the system databases's Access table (mentioned in other replies) with no reported issues. It will also audit any Dynamics SL table, except those with a column with an "image" datatype (such as PVRec, CustomVBA, etc.) and third-party tables that follow Dynamics SL SDK development conventions (for example, a final timestamp column and unique index). It works with SL 2011-2018 with the current service pack (CU 9 as of this reply).

    For more information: www.steadycode.com/steadyaudit

  • Suggested answer
    RROBERTSII Profile Picture
    62 on at
    RE: Auditing for SL

    http://www.gofastpath.com/

     GREAT PRODUCT and great customer service, Flexible and affordable

  • Community Member Profile Picture
    on at
    RE: Auditing for SL

    I have seen 3 cases where, after an upgrade, there were problems getting into SL after an upgrade and each of those times the problem was traced back to a trigger on the access table.

  • Community Member Profile Picture
    on at
    RE: Auditing for SL

    I used to sell a product (SL UserAccessLog) that did this in older versions of SL.  We dropped the product for a variety of reasons...including technical.  I would be very careful placing triggers on the Access table.

  • Community Member Profile Picture
    on at
    RE: Auditing for SL

    You could write a custom trigger.   This is not something I do but here is an example of an audit on the accthist  table.

    if exists (select * from sysobjects where id = object_id('xAcctHistAuditTable'))
    DROP TABLE xAcctHistAuditTable
    GO

    CREATE TABLE xAcctHistAuditTable(

    -- standard audit fields
    audit_log_id uniqueidentifier DEFAULT NEWID(),
    audit_user sysname DEFAULT SUSER_SNAME(),
    audit_changed datetime DEFAULT GETDATE(),
    NT_User char (50),
    hostname char(256),
    program_name char (50),
    sqltext varchar(4000),
    -- additional fields
    cpnyid char(10),
    acct char(10),
    sub char(24),
    ledgerid char(10),
    fiscyr char(4)
    -- add your additional fields below
    )

    if exists (select * from sysobjects where id = object_id('xAcctHistAuditTrigger'))
    DROP TRIGGER xAcctHistAuditTrigger
    GO

    CREATE TRIGGER xAcctHistAuditTrigger
    ON Accthist
          FOR  update
                AS
    set nocount on

    --TEMP TABLE TO RECORD SQL STATEMENT OF PROCESS FIRING THIS TRIGGER
    declare @CMD varchar(8000)
    CREATE TABLE #SQLBUFFER (EVENTTYPE VARCHAR(255), SPID SMALLINT, EVENTINFO VARCHAR(4000))
    SELECT @CMD = 'DBCC INPUTBUFFER('+ CONVERT(VARCHAR,@@SPID) +') WITH NO_INFOMSGS'
    INSERT #SQLBUFFER EXEC (@CMD)


    if (select COUNT(*) from master.dbo.sysprocesses where spid = @@SPID and program_name not like '%01520%' and program_name not like '%01560%') > 0
    begin
     -- Audit NEW record.    
     INSERT INTO xAcctHistAuditTable
                (NT_User,hostname,program_name,sqltext,CpnyID, Acct, Sub, LedgerID, FiscYr)
      -- add additional fields to the list above
           SELECT
      -- standard fields
             (select left(ltrim(nt_username),50) from master.dbo.sysprocesses where spid = @@SPID),
      (select left(ltrim(hostname),255) from master.dbo.sysprocesses where spid = @@SPID),
      (select left(ltrim(program_name),50) from master.dbo.sysprocesses where spid = @@SPID),
      (SELECT EVENTINFO FROM #SQLBUFFER),   
     CpnyID, Acct, Sub, LedgerID, FiscYr
           FROM inserted
    end
    -- End of Trigger
    go

  • Cynthia Audain Profile Picture
    1,348 on at
    RE: Auditing for SL

    Hi Rick

    Thanks so much for your response.  I was playing around with the access table and I did realized that after logging out the record disappears from the table.

    Your suggestion of writing a program to poll the table or a trigger are valid suggestions.  I will look into the latter to see if I could come close to what the customer wants.

    Sure do hope that there is an add-on out there that could help.  So far, the add-ons that I have seen do not seem to have that functionality.

    Anyway, thanks for your suggestions.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Auditing for SL

    Lisa,

    Dynamics SL does not track this information.  The closest you can get is the access table in the system database.  That table will have an entry for each SL screen (including the main menu) that is open for any active user.  The table does have an access date field but this field only includes the date and not both the date and time.  Also, unfortunately, those records go away when the user logs out of SL.  So, you would have to write a program that polls this table on some periodic basis and records users found into your own SQL table.  You would have to poll this table rather frequently if you wanted to get a close estimate as to when the user logged out of SL.  You other option, I suppose, would be to place a trigger on this table and update your own user tracking table each time a record is added to this SL table.

    I am not aware of any third party addition that does this but that is not to say there isn't one.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans