Announcements
No record found.
Hi All
I am going to write a function to export filtered data into excel in D365FO. I know how to write function for exporting data to excel. However, when I add this function into RunBase class, it always got error at "file::SendFileToUser(memoryStream,"Test.xlsx");". Does anyone have idea about how to write export data in Excel with RunBase?
Sorry, please let me correct information for above.
when I debug, it can successfully pass "file::SendFileToUser(memoryStream,"Test.xlsx");". However, in the final, file is not downloaded, and get error "An internal error has occurred. Please contact your system administrator."
Best Regards,
Jack
Aren't you running it in a batch? Trying to use SendFileToUser() in batch is logically wrong, because there is no user's browser to send the file to. The process is executed on a batch server, not by a user.
You need to save the file somewhere where users can download it from later, or activelly send it to users in some way. For example, you can save attach the file to a record in F&O, send it by e-mail, store it in Azure storage and so on.
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 616
André Arnaud de Cal... 460 Super User 2026 Season 1
Syed Haris Shah 331 Super User 2026 Season 1