Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unload to download a file multiple times

SA-76048

Summary



Unload to download a file multiple times. The file is downloaded only the first time. Additionally, Refresh section does not work correctly.


Error Messages



Not Applicable


Steps to Reproduce

  1. Configure a button to download a Word or Excel file.
  2. Call the activity in the RefreshSection action. File download occurs only the first time.


Root Cause



A defect in Pegasystems’ code or rules.
The section was refreshed and the activity call did not occur.



Resolution



Perform the following local-change: 
  1. For multiple file downloads, include the following script in UserWorkForm,

    <script>
    function downloadFile(activityNameclassNameapplicationNamefileNamefileType){
    varsuURL = SafeURL_createFromURL(pega.u.d.url);
    suURL.put("pyActivity", activityName);
    suURL.put("pyClassName", className);
    suURL.put('ApplicationName', applicationName);
    suURL.put('FileName', fileName);
    suURL.put('FileType', fileType);

    varformEle = document.createElement('form');
    formEle.id = "download_file";
    formEle.method = "POST";
    formEle.action = suURL.toURL();
    if(pega.env.ua.webkit)
    formEle.target = "";
    document.body.appendChild(formEle);
    formEle.submit();
    document.body.removeChild(formEle);
    }
    </script>

     
  2. Call the downloadFile method in the runScript action.

    //In order to refresh the section after executing the script.

     
  3. Use the Wait method in any activity and call that activity using the runActivity action.
  4. After the runActivity action, provide the RefreshSection as the third action in the button action set.

Published August 19, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us