I have an strange error with Customer account statement (External) run in Batch
If i run this report and asks for output to email as PDF document, then after anywhere from 20 - 40 successful prints i get an error.
Info Infolog for job Customer account statement (5638672634)\Infolog for task Customer account statement (5639915233) The report has been successfully sent as attachment to email.
Info Infolog for job Customer account statement (5638672634)\Infolog for task Customer account statement (5639915233) The report has been successfully sent as attachment to email.
.......... Cut out successfully printed messages.
Error Infolog for job Customer account statement (5638672634)\Infolog for task Customer account statement (5639915233) Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.
at Dynamics.Ax.Application.SrsPrintMgmtController.Outputreports() in SrsPrintMgmtController.outputReports.xpp:line 96
at Dynamics.Ax.Application.CustAccountStatementExtController.Runprintmgmt() in CustAccountStatementExtController.runPrintMgmt.xpp:line 132
at Dynamics.Ax.Application.SrsPrintMgmtController.Run() in SrsPrintMgmtController.run.xpp:line 30
at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54
at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13
at BatchRun::runJobStatic(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at BatchIL.taskThreadEntry(Object threadArg)
Now if I run the report without batch, it completes with no problems.
And if I use file (PDF) as output from the report and runs is in batch, it completes.
If i make the output to email as a CSV file, then the report runs for longer but will still eventually fail with the same error.
It seems like the place where it fails is in this code:
SrsPrintMgmtController.outputReports() line 96
// If report execution was not successful or user cancelled, then throw an error.
// We will throw it for non-client cases e.g. batch or purely running on server.
// We will not throw the error message, since infolog will already contain the actual error message from the source of the error.
if(cancelRun || (!executionInfo.parmIsSuccessful() && new Session().clientKind() != ClientType::Client))
{
throw Exception::Error;
}
But i can't figure out why it is failing.