Please wait
Talk to Expert
Microsoft Dynamics Business central

Downloading Multiple files in Business Central

Banner_How to Download Multiple files in Business Central
Downloading multiple files in Microsoft Dynamics 365 Business Central involves generating or fetching files, bundling them together, and allowing users to download them efficiently. This feature can be useful in scenarios like exporting reports, customer documents, invoices, or other business data.

In this blog, we will explore how to download multiple files simultaneously in Microsoft Dynamics 365 Business Central.

By default, the DownloadFromStream function allows us to download a single file. However, when attempting to use it for multiple files, only the last file will be downloaded. To address this issue, we need to package the files into a ZIP folder and download the ZIP instead.

The DownloadFromStream function handles single file downloads. When processing multiple files without bundling, it overwrites previous files, leaving only the last one. By creating a ZIP folder, we can include all files and download them as a single package.

AL Code Example

Below is an example of how to download multiple files in a ZIP folder:

1. I have created Action named “Download Customer Data” on customer list page to download ZIP file which will store each customer details in separate file:

Download Multiple files via AL in Business Central

2. By calling the Action, Zip Folder containing multiple files will be download as below:

Download Multiple Files via AL in Business Central

3. See below screenshot of few files which are having different details in each file:

Download Multiple Files via AL in Business Central

Download Multiple Files via AL in Business Central

By following this approach, you can easily download multiple files in Business Central as a single ZIP folder. This ensures that all files are included and avoids the limitation of the DownloadFromStream function handling only one file at a time.

Thanks for reading!!

If you’re curious about how we can assist you in reaching your goals, don’t hesitate to get in touch. Our dedicated team is ready to provide support every step of the way.

Let’s turn your vision into reality together!