web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Strange error on long running Customer account statement (External)

(0) ShareShare
ReportReport
Posted on by 4,079

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.

*This post is locked for comments

I have the same question (0)
  • Rudi Hansen Profile Picture
    4,079 on at

    No one has anything helpful?

  • Verified answer
    Rudi Hansen Profile Picture
    4,079 on at

    I finally found the problem.

    It all has to do with this issue of temp files not being deleted on the AOS server.

    https://blogs.msdn.microsoft.com/floditt/2010/01/25/delete-temp-files-when-sending-mails-with-attached-files/

    It turns out that in SrsReportRunPrinter.Toemail line 38, the temp file is moved to the PDF file that has to be attached to the report, but apparently since the old temp files are newer deleted, it can happen that the file already exists.

  • bhaveshbarot2004_05 Profile Picture
    35 on at

    Hi Rudi,

    Thanks for your post. It helped me & saved my huge time.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans