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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

create a plugin that return a file to the browser when clicking a button

(0) ShareShare
ReportReport
Posted on by 15

Hi,

I would like to create a button that will download an accounting file in the browser, as same as you export a view to an excel file.

The file format is a bit complex and I believe it would be easier to do it using a plugin in C#.

I can save the file in dataverse, as an email attachment etc... but I couldn't find anything about how to return the file to the browser.

Do you know if is it possible?

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    you can't do with a plugin, you can do with a mix of JavaScript (that will be executed from the button click and return the file inside the browser) and a Custom Action (the server side code in C# to create the file)

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at

    Hi vnussbaum,

    Since plug-in runs at server side, it cannot return the file to browser. But, from plug-in, you can save the GUID of the file attachment created in a field on parent record where you have a button. Few seconds after clicking button (you can use timeout) or on change of GUID field call a javascript function which downloads a file in the browser using the stored GUID.

  • vnussbaum Profile Picture
    15 on at

    Thank you for your responses.

    I also found you can use javascript to download the stored file but I don't like this way :)

    I feel it's a bit ..... to create a file, download it and then delete it.

  • Charan Raju C R Profile Picture
    7 Moderator on at

    If you don't like the mixed approach, you can implement it fully using javascript including a complex excel format and logic.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans