Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Database Logging

$
0
0

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,


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>