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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • WillWU Profile Picture
    22,361 on at

    Hi CJ,

    Did you try to debug your code?

    Please provide more details of the exception.

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    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

  • Suggested answer
    Mahmoud82 Profile Picture
    50 on at

    Please check this Post it might help in this case 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans