Montag, Mai 08, 2006

Axapta Audit Trail (Table TransactionLog)

2 things about the audit trail:


  1. Palle Agermark has posted an interesting article about the audit trail and when records will be created depending on the TTS level of the application. You can read it here: http://blogs.msdn.com/palle_agermark/

  2. We recently ran into the problem that we got error messages in Axapta saying "Cannot create a record in Audit Trail. The record already exists." We are running Axapta 3.0 SP3 (upgraded some years ago from 2.5). Unfortunately, the error is repaired in SP4, but you can actually repair it also in SP3.

    Go to the class "ReleaseUpdateDB_V30toV30SP" and copy the method "RepairTransactioIdPerTableV30toV30SP" into a new job. (NB: The method will only exist in a SP4 or SP5, of course).
    In the job, you have to comment the first line after the variable declaration, that is this.tableProgress(tablename2id('dataArea'));
    You can run the job and all your entries in the SystemSequences table will be corrected.

    Please also check the table SQLSYSTEMVARIABLES in your database. Check the value for the parm "Index". If it is below 256, you also have a second problem -> please write a comment and will explain further what to do.

Kommentare:

Palle Agermark [MSFT] hat gesagt…

In 4.0 we have made two major changes to number sequence for the transaction id which the audit trail use.

The id is now a 64 bit value allowing for huge numbers of transactions to be recorded and also the number sequence is now global accros company accounts.
The global transaction id is important since a transaction can obviously span several company accounts, for example when you use the new intercompany features.

Michael Niemeyer hat gesagt…

Hi,

our value for parm "Index" in SQLSYSTEMVARIABLES is only 41 Iparm is 13.

What is the problem, and what can we do?

Best regards
Michael

Anand hat gesagt…

Hi, I am finding the same problem for other tables in Ax 4 SP1. I need your help in this regard.

Even if we try to reset the Number Seq for which we receive comment... next time it display another table with such error.

ben hat gesagt…

HI,

our sqlsystemvariables PARM column size is 30 , IPARM is 4, what should we do to fix that problem? Thanks

Regards,
Bryan

PavanKumar Idupulapati hat gesagt…

I have resolved the same issue in AX 2012,
To over come this issue, please find the below code modifications in Tables-->TransactionLog-->Methods-->create.
The existing Code:

if (appl.lastTransactionIdCreated() != appl.curTransactionId())
{
transactionLog.Type = _type;
transactionLog.Txt = _txt;

transactionLog.insert();

appl.lastTransactionIdCreated(transactionLog.CreatedTransactionId);

appl.transactionlogUpdateTTSControl().revoke();
}



The changes to make:

if (appl.lastTransactionIdCreated() != appl.curTransactionId())
{
if (!TransactionLog::find(appl.curTransactionId()))
{
transactionLog.Type = _type;
transactionLog.Txt = _txt;

transactionLog.insert();

appl.lastTransactionIdCreated(transactionLog.CreatedTransactionId);
}
appl.transactionlogUpdateTTSControl().revoke();
}

Regards
Pavan