Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Download the files from the Grid records on click of Custom Download Button

(1) ShareShare
ReportReport
Posted on by 399
Hi All,
 
I have a requirement, where A subgrid contasns the number of records and each record has a document stores on share point.
My requirement like, there should be a download button on grid level, when user will select the records from the grid and will click on the download button then all the documents from each selected record should be downloaded and stored on a local folder.
 
 
Like Below attached SS, there is /File Tracking/ subgrid and here I need to add the download button on subgrid level, as user will select the record then the documents from these records should be downloaded.
 
 
 
And under this file tracking record the documents are  uploaded like this:
 
 
I have added the Download button on subgrid and button click, I am getting the records Id as well.
 
And I have a Field Name /File Path/. In this Field I am storing the sharePoint File path(decoded Url), So here I can get the selected records Id and through that Id I can get the records information and this /File Path/ as well.
 
So Is there Any way to download the sharePoint Documents using the File Path, through javascript??
 
 
 
 
 
  • CU08080724-3 Profile Picture
    2 on at
    Download the files from the Grid records on click of Custom Download Button
    Hi,
    Did you solve this problem? Create the button in the grid and download the selected files? Can you show me how you did it? Thanks!
  • Himanshu Kamboj Profile Picture
    399 on at
    Download the files from the Grid records on click of Custom Download Button
    Hi,
     
    I did it Already, like I have added a download button and on select of record, when we will click on download button I am getting the records id.
     
    And through that records Id I can get the records information using retrieve query, but the question is, how to download the document associated to this particular records and this document is store on sharepoint. But the good thing is here, like I have a field name "File Path", this field contains the Document Path on SharePoint.
     
    So is there any way to download the documents from the sharePoint using that File Path??.
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Download the files from the Grid records on click of Custom Download Button
    Hi,

    You can leverage the Ribbon Workbench from XrmToolbox: https://www.develop1.net/public/rwb/ribbonworkbench.aspx to perform the ribbon/button changes.
    Step 1. Customize a solution with the entity you want to add button to. Then add this solution in the Workbench.

     
    Step 2. Drag the BUTTON from the Toolbox to the subgrid row.
    The button can be found in the Solution elements below and its display name can be edited in the properties.

     
     
    Step 3. Add an action to the button.
    1. Click the “+ ”button to create a new command. Add the action in the properties, either URL or JavaScript.
    JavaScript needs to be previously uploaded to the WebResourse in Default solutions. And here we have added URL action as an example for the opportunity entity. You can add JS about downloading files here.
    1. Add an enable rule: Show button when record is selected.
    1. Add the enable rule to the command.

     
    1. Add the command to the custom button and publish.

     
    The effect is as shown in the figure, showing the customized button in the Opportunity tab when the record is selected.

     
     I hope my answer is helpful to you! If you have any other questions, please feel free to contact me.
     
    Best Regards,
    Dengliang Li

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans