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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Database log not working

(0) ShareShare
ReportReport
Posted on by

Hi All,

i wish to log all actions with ledger journals and vendor payment journals.

So i run into System administration > Database log setup and added some ledger journal fields to logging:

Database-log-setup-_2D002D00_-Finance-and-Operations-2017_2D00_08_2D00_08-21_2D00_25_2D00_40.png

For example, i modified General ledger description. But if on GL journal form Options > Record info > Database log i see nothing:

4426.Log.png

What's is my mistake? Does anybody succeed in setting up journals log?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    A general problem with the database log is that you have to identify the correct table to log. This is not always easy because the log wizard shows you labels only, which are not unique, meaning that you might simply have selected the wrong table.

    Irrespective of that, I would in general not log ledger transactions because of performance issues. Probably rethink if this is really required.

    Best regards,

    Ludwig

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    can you try steps from below article and see if it works for you. If it works you must be setting it on wrong field.

    www.linkedin.com/.../dynamics-ax7-database-log-sten-baumgarten

    Also as Ludwig suggested look at the performance section in the following article

    technet.microsoft.com/.../dd362089.aspx

    Database logging and performance

  • PA-22040759-0 Profile Picture
    6,194 on at

    I believe implementation of the database log has changed in the July 2017 / Platform 8 release. Could you please confirm what Application and Platform version you are on? That will be helpful in trying to reproduce the issue. Thanks.

  • Maxim_msk Profile Picture
    on at

    Palle, for now i am on Update 8. The settings to log GL journal first time i made in Update 6 so nothing changed here for me.

    I checked database log on Vendor's memo field and log works. But not for GL journal.

    Did anyone success in setting GL journal log?

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    The database log implementation is changed in Update 8. Writing to the database log used to be handled from the AOS. In Update 8 this is done from SQL Server triggers on the tables in the database.

    So if you have a setup from an older version and haven't run any data upgrade, I would imagine that you are missing the triggers. Could you check those?

  • Maxim_msk Profile Picture
    on at

    Palle, how i may run data upgrade or verify what it's done?

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    Documentation on the upgrade process is here: docs.microsoft.com/.../upgrade-latest-update

    If you just want the triggers to be created, you can probably get that done by just running the wizard again.

    It have tried it now for LedgerJournalTable. The tricky part being to figure out which "Ledger journal table" to create the trigger for.  There are five "Ledger journal tables" to choose between.

    I chose the one having a PaymentsGenerated_IT field, as this field is only present on the actual LegderJournalTable table. It's the fourth "Ledger journal table" on my system:

    2017_2D00_08_2D00_09_5F00_13_2D00_09_2D00_50.png

    That creates this trigger in SQL:

     2017_2D00_08_2D00_09_5F00_13_2D00_09_2D00_50.png

    And this is the result from a small test:

    2017_2D00_08_2D00_09_5F00_13_2D00_12_2D00_03.png

    A side note is that is seems like the trigger is not removed again from the database if you remove a table from the setup. I consider that to be a bug.

  • Axaptus Profile Picture
    10 on at

    Hi Palle, thanks for sharing this info.

    I have a doubt about how to monitor create/update/delete events globally.

    I've built a solution which is based on the callbacks that kernel calls when using the Events framework. About kernel triggering you mentioned in your recent blog post, "you can still find the old application code in Update 8, but it is not triggered anymore."

    Do you refer to the DatabeseLog events only (logInsert, logUpdate, logDelete, logRename)? Or also EventCUD triggers were included? (eventInsert, eventUpdate, ...)

    Is there a better way to monitor these events? (delegates, kernel events, etc)

    I hope someone can throw some light on this.

    Thanks!

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    I was thinking about the logInsert, logUpdate, logDelete and logRenameKey methods in the Application class. You can still see them, but they don't seem to be called anymore.

    The EventCUD triggers on SysDataBaseLog are also not called, since the records are now being inserted directly from the database, outside the AOS of Dynamics.

    I'm working on a solution where we need to track CUD dynamically on user specified tables. Earlier we have piggybacked on the database log, but now we also create triggers. Since both the database log now and earlier the "Cross-company data sharing" feature does this, I think it is a viable approach to take. You can check the code in the DataSharing model to see how triggers can be created from Dynamics. I haven't checked where the code is for creating the database log triggers, but that is probably more relevant for the stuff you work on.

    To build something inside Dynamics with event handlers, Lane Swenka has made this nice solution, or proof of concept if you want: www.axdeveloperconnection.it/.../runtime-eventing-dynamics365-operations

    Lanes solution adds an overhead to all transactions, having a negative impact on performance for all tables, and it calls stuff that Microsoft might change without any notice. In relation to my product, I don't have the guts to use that approach.

    If your stuff is covered by entities, you might be able to benefit from the change tracking that you can setup on the entity in "Data management".

    I don't know of any better ways...

  • Axaptus Profile Picture
    10 on at

    Thanks Palle!

    I'm going to check the material that you've provided.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans