tag:blogger.com,1999:blog-954811220271201663.post465393001087381995..comments2024-02-27T07:17:38.402+02:00Comments on F.A.Q. for Dynamics AX: Transaction Log - AX 2012 - Cannot create a record in Audit trail (TransactionLog)Anonymoushttp://www.blogger.com/profile/00924659236536987465noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-954811220271201663.post-29048577975503295152015-04-13T12:39:51.383+03:002015-04-13T12:39:51.383+03:00Hi
I have resolved the same issue in AX 2012,
To...Hi <br /><br />I have resolved the same issue in AX 2012,<br />To over come this issue, please find the below code modifications in Tables-->TransactionLog-->Methods-->create.<br />The existing Code:<br /><br />if (appl.lastTransactionIdCreated() != appl.curTransactionId())<br />{<br />transactionLog.Type = _type;<br />transactionLog.Txt = _txt;<br /><br />transactionLog.insert();<br /><br />appl.lastTransactionIdCreated(transactionLog.CreatedTransactionId);<br /><br />appl.transactionlogUpdateTTSControl().revoke();<br />}<br /><br /><br /><br />The changes to make: <br /><br />if (appl.lastTransactionIdCreated() != appl.curTransactionId())<br />{<br />if (!TransactionLog::find(appl.curTransactionId()))<br />{<br />transactionLog.Type = _type;<br />transactionLog.Txt = _txt;<br /><br />transactionLog.insert();<br /><br />appl.lastTransactionIdCreated(transactionLog.CreatedTransactionId);<br />}<br />appl.transactionlogUpdateTTSControl().revoke();<br />}<br /><br />Regards<br />Pavan<br />PavanKumar Idupulapatihttps://www.blogger.com/profile/10449209809299039149noreply@blogger.com