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 NAV (Archived)

Email - Error Message

(0) ShareShare
ReportReport
Posted on by

Hi,

Has anyone encountered an error message "An unexpected error occurred. Try the operation again or contact your system administrator." as shown below when clicking post and sales invoice?

Although the error message occurs, the sales invoice is posted successfully and email is received. It is just annoying that I have to click "OK" to move on.

Did I miss any setup?

Email-_2D00_-Error-Message.PNG

Regards,

Susy

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi,

    The error occurs after these operations.

    Try with the debugger to identify the origin of the error message.

    Regards,

    L

  • ManishS Profile Picture
    86 on at

    Is the email functionality customized or standard ?

  • Community Member Profile Picture
    on at

    Hi Manish,

    It is standard.

  • Suggested answer
    Maneesha Profile Picture
    5,891 on at

    Dear Susy K ,

    check whether your "Launch Application" & "email setup" are arrange properly  

    check email configuration

  • Community Member Profile Picture
    on at

    Hi,

    Not trying debug ?

    Is your sent document saved on a disk path (client) as a file ?

    L

  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    Take help from developer and debug the error using debugger

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    I am thinking this could be because of SMTP, can you try this on the server and see if you get the same message or any other computer.

  • Community Member Profile Picture
    on at

    Thank you all for your feedback.

    I have tried on my laptop and on the server, both encounters the same error message.

    Debug the code and it seems the code error while trying to save the file as PDF into the folder.

    Email-_2D00_-Error-Debug-Break.PNG

     
      IF CustomReportLayout.GET(CustomReportSelection."Custom Report Layout ID") THEN BEGIN
        ReportLayoutSelection.SetTempLayoutSelected(CustomReportLayout.ID);
        REPORT.RUNMODAL(CustomReportSelection."Report ID",NOT HideDialog,FALSE,HeaderDoc);
        ReportLayoutSelection.SetTempLayoutSelected(0);
      END ELSE
        IF NOT REPORT.SAVEASPDF(ReportID,ServerAttachmentFilePath,HeaderDoc) THEN
          ERROR(ServerSaveAsPdfFailedErr);
     

    Where to set the default folder?

    Thanks.


    Regards,

     

    Susy

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    What is the value for ServerAttachmentFilePath ? can you make sure the service user has all the permissions for that folder. Other thing also check what is the value for ReportID and HeaderDoc(Filters, and Primary Key Values) and try to run the report for that manually and see if you get the report generated.

    You will get the error if there is no data and if no file is generated.

  • Verified answer
    Community Member Profile Picture
    on at

    Thank you all for the answers.

    Finally fix the issue. I didn't have any setup under "Documents Layout" in Customer Card. The moment I populate it for Invoice, there is no error message.

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 NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans