Cannot create a record in General journal entry (GeneralJournalEntry) in AX 2012

Hi All,

I am working in AX 2012, while i am posting a Invoice for Purchase Order facing the following error.

Cannot create a record in General journal entry (GeneralJournalEntry). Date: .

The record already exists.

An error occurred during update

Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ErrorException’ was thrown.

at Dynamics.Ax.Application.FormletterService.Run() in FormletterService.run.xpp:line 217

at Dynamics.Ax.Application.FormletterService.Postpurchaseorderinvoice(PurchFormLetterInvoiceContract _contract) in FormletterService.postPurchaseOrderInvoice.xpp:line 14

at FormletterService::postPurchaseOrderInvoice(Object , Object[] )

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)

at Dynamics.Ax.Application.SysOperationServiceController.Runoperation(Boolean _async) in SysOperationServiceController.runOperation.xpp:line 93

at Dynamics.Ax.Application.SysOperationServiceController.runServiceOperation(Object[] parameters) in SysOperationServiceController.runServiceOperation.xpp:line 22

at SysOperationServiceController::runServiceOperation(Object[] )

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

at Dynamics.Ax.Application.SysDictClass.invokeStaticMethod(Object[] _params) in SysDictClass.invokeStaticMethod.xpp:line 26

at SysDictClass::invokeStaticMethod(Object[] )

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

at Microsoft.Dynamics.Ax.Xpp.PredefinedFunctions.runAsInvoke(String className, String staticMethodName, Object[] parms, Object[]& exportInfolog)

Can any one help me in this.

Thanks in Advance

FormLetterService.run() tries to insert a record to GeneralJournaEntry but the same record (according to unique indexes) already exists. It may be a bug in code, a problem with a number sequence or a more general data issue.

I would use debugger to see what values are being inserted - it’s usually quite obvious what’s the problem.