Announcements
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
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
Hi CJ,
Did you try to debug your code?
Please provide more details of the exception.
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator