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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Need to return file from a custom action

(1) ShareShare
ReportReport
Posted on by

Hi,

I currently face a weird request. I want to add a button to download files from an external REST API. For some specific reasons I must not calls the service from client side. So I'm trying to use an Plugin registered on a custom action and then call the custom action in JavaScript web resource. My question is how to return a binary from custom action? Did any one face the same need and can help me?

May be my approach isn't the best. Any proposal will be welcome.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    I think you should convert your file to Base64 and return as "string" output parameter from custom action.

    At clientside, you can use FileSaver.js (github.com/.../FileSaver.js)

  • Community Member Profile Picture
    on at

    Emre,

    Your solution fits well what I need. I try it with FileSaver.js, and I can download my files.

    Thank you for your help.

  • Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    I'm happy to hear that.

    If it's not private can you share your code for future questions? maybe someone will have same question like you.

  • 00037FFE470C2A4A Profile Picture
    5 on at

    Hello Kfranck

    Could you please share your solution,

    I face this issue.

    Thank you in advance.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans