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 Logging

(0) ShareShare
ReportReport
Posted on by

Hi,

i want to enable database logging on the vendtable, specifically the accountNum field.

I went to the Sys Admin Module, and under the databse section clicked on the Database log setup link.

I went to General Ledger -> Supplier (2), and enabled this field (AccountNum).

I went to test by changing a suppliers accountNum... (Right click on the field ->Record Info-> Rename)... it was not caught.

The code im using to extract the changes (it works for other fields):

SysDatabaseLog sysDbLog;
DictTable dTable;
VendTable vend;
container conData, conField;
int i;
str fieldName;
ItemId oldFieldValue, newFieldValue;

//Get Changes from VendTable
dTable = new DictTable(tableName2id("VendTable"));
while select sysDbLog where sysDbLog.table == dTable.id()// && sysDbLog.Username == "Matthias Pace"
{
conData = sysDbLog.Data;
for (i=1; i<=conLen(conData); i++)
{
conField = conPeek(conData, i);
fieldName = conPeek(conField,1);
newFieldValue = conPeek(conField, 2);
oldFieldValue = conPeek(conField, 3);


select vend where vend.RecId == sysDbLog.LogRecId;

info(strFmt("%1 - %2 :: %3: %4-------%5", vend.AccountNum, vend.name(), fieldName,newFieldValue, oldFieldValue));
}
}

Any Ideas?

Thanks and Kind Regards,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    You didn't say which type of changes you're logging. Don't forget that "update" and "rename key" are two different events.

  • Community Member Profile Picture
    on at

    i want to capture update changes.... it should be on update right?

  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    If you want to capture changes, you chose a wrong test case. Renaming primary key isn't the same thing as a normal field change. That's why you have two distinct events (update and rename key).

  • Community Member Profile Picture
    on at

    All fields except Update is disabled... how can i enable them?

  • Anton Venter Profile Picture
    20,346 Super User 2025 Season 2 on at

    Hi, you have to do the database log setup again and enable them.

  • Community Member Profile Picture
    on at

    I did that... i deleted all the supplier related fields and started all over again.

  • Community Member Profile Picture
    on at

    Solved: i entered it via x++ and flushed the systemdbLog setup

    Link: community.dynamics.com/.../42459

    Thanks All

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