SalesforceLabs / AllOnboard

With All Onboard Starter Pack, you can seamlessly onboard anyone, in one consolidated place and in no time at all.
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

Issue with Download Form Button #2

Open zara-gm opened 1 year ago

zara-gm commented 1 year ago

Issue with Download Form Button

Hello,

I'm currently investigating how to make the Download Form button work correctly (located in the Financial details section), as it is not functioning as intended (please refer to the screenshots below).

Download Form

The download form is not visible in the Utility Flow - Create Records from Flow Session

Utility Flows

Content Document Link

I was able to find it in the code, but I'm affraid that it won't be possible to modify due to being a managed package. src/aura/DocumentUploadCmp/DocumentUploadCmp.cmp

<lightning:layoutItem class="slds-p-top_x-small" flexibility="auto" alignmentBump="right">
                                            <aura:if isTrue="{!not(empty(v.selectedDocument.document.File_Link__c))}">
                                                <lightning:button iconName="utility:file" label="Download Form" onclick="{!c.handleLinkClick}"
                                                                  value="{!v.selectedDocument.document.File_Link__c}"  />
                                            </aura:if>
                                        </lightning:layoutItem>

We have two possible solutions in mind:

  1. Determine a method to activate the link's functionality and enable customization of the file/form.
  2. Explore the possibility of hiding or relocating the button to facilitate the addition of our own link for customization.

Your assistance in resolving this matter would be greatly appreciated. Thank you so much!

AppExchange Listing

https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMiQpUAL

Documentation

How to use All Onboard Starter Pack

psagredo99 commented 3 months ago

same issue here, i think this funtionality has never worked

psagredo99 commented 3 months ago

If anyone need a solution, go to DocumentUploadCmpController.js and modify handleLinkClick with:

handleLinkClick : function(component, event, helper) {
        var fileUrl = event.getSource().get("v.value");
        var link = document.createElement('a');
        link.href = fileUrl;
        link.download = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    },

It works fine