Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

An internal error has occurred. Please contact your system administrator

(0) ShareShare
ReportReport
Posted on by 512

Hi Guys,

I have an issue regarding to send file to the user. I am running the batch and consolidate all the records and send the file to the user. Here is my code below. But I have an error to display after batch running "An internal error has occurred. Please contact your system administrator". 

 //Zip File
                    using(System.IO.MemoryStream zipArchiveStream = new System.IO.MemoryStream())
                    {
                        using (ZipArchive zipArchive = new ZipArchive(zipArchiveStream, ZipArchiveMode::Create, true))
                        {
                            ListEnumerator sb = lstSales.getEnumerator();
                            while(sb.moveNext())
                            {
                                BAMSalesOrderHeader header = sb.current() as BAMSalesOrderHeader;
                                ZipArchiveEntry dataFileEntry = zipArchive.CreateEntry(header.FileName());
                                using (System.IO.Stream dataFileEntryStream = dataFileEntry.Open())
                                {
                                    this.ReadTextInList(header, dataFileEntryStream);
                                }
                            }
                        }
                      
                        File::SendFileToUser(zipArchiveStream, package   extensionZIP);
                    }                                                          
                }                                           

Thank you for your response.

Regards,

CJ

  • Suggested answer
    Mahmoud82 Profile Picture
    50 on at
    RE: An internal error has occurred. Please contact your system administrator

    Please check this Post it might help in this case 

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: An internal error has occurred. Please contact your system administrator

    Hello CJ,

    Is this issue related to AX or D365FO?

    Would be great if you could provide some additional information on the system version that you operate.

    Many thanks,

    Ludwig

  • WillWU Profile Picture
    22,352 on at
    RE: An internal error has occurred. Please contact your system administrator

    Hi CJ,

    Did you try to debug your code?

    Please provide more details of the exception.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans