Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

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

Posted on by 379
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
    CU08080724-3 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
    Himanshu Kamboj 379 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
    Dengliang Li 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans