Transaction Log - AX 2012 - Cannot create a record in Audit
trail (TransactionLog)
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
1 comment:
Hi, I used your post with your reference.
Post a Comment