One of our colleagues recently had a requirement for having a dialog form with multiple toggle buttons to export several different files.
So, the standard procedure for exporting to CSV in D365 is:
to create a ‘CommaStreamIo’ object,
fill it with data
and then send a file to the user (File::SendFileToUser(stream, filename)) which file then gets downloaded from the browser.
However, the issue with this approach appears when we try to export multiple files with the same function, i.e. ‘File::SendFileToUser(stream, filename)’. In such a case, only the last file gets downloaded.
The solution to this is to use temporary storage, get the link from it and open it in a new tab:
We hope that this blog post is helpful, especially if you have found yourself in some simmliar situation.
Allow All Cookies
Third Party Embedes
Third-party cookies are cookies that are set by other websites, not this one. This website may use embedded content from other websites, such as YouTube or Google maps. Your consent is required to view content from these websites embedded on this site.