Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

Portal - How to show more than 1 file attachment control?

Posted on by 2,811

Hi All,

Thanks for reading my post. 

My question is related with Dynamics 365 Portal (online). I need to have more than 1 File Attachment control on the page. Now, my question is how to achieve it? 

Fyi, I already know one file attachment control can upload multiple files. Following is the desired result I'm after:-

MoreThan1FileAttachment.png

  • cloflyMao Profile Picture
    cloflyMao 25,196 on at
    RE: Portal - How to show more than 1 file attachment control?

    Hi Zohaib,

    You could still create a preview for multiple files.(create a container to show items, run following code at document.ready)

    Reference:

    https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications

    setTimeout(function() {
                const inputElement = document.getElementById("AttachFile");
                inputElement.addEventListener("change", handleFiles, false);
    
                function handleFiles(e) {
                    const fileList = this.files;
                    const previewer = $('#FilePreview');
                    var list = '
      '; for (var i = 0;i < fileList.length; i ) { list = '
    • ' fileList[i].name '  ' Math.round(fileList[i].size / 1024) 'KB  
    • '; } list = '
    '; previewer.html(list); console.log(fileList); } }, 3000);

    pastedimage1579490153143v1.png

    I think due to we couldn't make customization on submit event, thus we couldn't filter desired items to final submitted data.

    So adding multiple file control as your desired screenshot show might not be achieved, because upload function is finally decided by Portal, we are restricted to change final upload code.

    Regards,

    Clofly

  • Zohaib Uddin Khan Profile Picture
    Zohaib Uddin Khan 2,811 on at
    RE: Portal - How to show more than 1 file attachment control?

    Hi Clofly,

    Thanks for the reply. And, updating us about the Multiple files option. But, at this moment that's not acceptable by the business.

    If you need Pop-up dialog for the upload then use Web Form rather than Entity Form. Entity Form doesn't provide that.

    FileUpload_2D00_WebForm.JPG

  • cloflyMao Profile Picture
    cloflyMao 25,196 on at
    RE: Portal - How to show more than 1 file attachment control?

    It seems that we would get a popup dialog for upload in old adx portal,

    currently it just shows us a "Choose file" button.

    Regards,

    Cloflyu

  • cloflyMao Profile Picture
    cloflyMao 25,196 on at
    RE: Portal - How to show more than 1 file attachment control?

    Hi Zohaib,

    Even if there is one file upload control, but if you had enable Allow Multiple Files option, 

    then you could upload multiple files at one time, and you'll find button text will change from "Choose file" to "Choose files"

    pastedimage1579230827949v1.png 

    pastedimage1579231100608v1.png

    Button without check the option and you can only select one file in popup dialog.

    pastedimage1579231032095v1.png

    Regards,

    Clofly

  • Zohaib Uddin Khan Profile Picture
    Zohaib Uddin Khan 2,811 on at
    RE: Portal - How to show more than 1 file attachment control?

    Thanks for the reply Clofly.

    Could you elaborate what do you mean by Choose Files button and its parent Add Files dialog would be only option for us to upload file in online portal? If I understand you correctly I need to do following:-

    1. Create Entity form (Marked as File attachment).

    2. Create Web Template.

    3. Call step # 1 entity form into Step # 2 web template.

    With above steps it will bring only one File Upload control. So what shall I do next?

    Building another web application is not an option at the moment.

  • cloflyMao Profile Picture
    cloflyMao 25,196 on at
    RE: Portal - How to show more than 1 file attachment control?

    Hi Zohaib,

    As far as I know, portal uses browser default file upload control,

    so Choose Files button and its parent Add Files dialog would be only option for us to upload file in online portal.

    You should build your own web application if you would like to have the desired effect in your screenshot.(It looks like jQuery File Upload) 

    Regards,

    Clofly

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,628 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,914 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans