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

Unable to select a value on the Autocomplete box

SA-98601

Summary

Unable to select a value on the Autocomplete box. This occurs while exporting a grid using the Pega out-of-the-box ExportToExcel functionality. A script is used so that user can download the Excel file on the same window.


Error Messages

Not Applicable


Steps to Reproduce

  1. Add the below script to the UserWorkForm:
    function downloadMSExcel2(fsFileName, templateRFB, downloadFile ){ 
           var strUrlSF = SafeURL_createFromURL(pega.u.d.url); 
           strUrlSF.put("pyActivity", "Generateexcel"); 
           strUrlSF.put("FSFileName", fsFileName); 
           strUrlSF.put("TemplateRFB", templateRFB); 
           strUrlSF.put("DownloadFile", downloadFile); 
           
           var formelem = document.createElement('form'); 
           formelem.id = "formExportViewToExcel"; 
           formelem.method = "POST";       
           formelem.action = strUrlSF.toURL();
           formelem.target = ""; 
           document.body.appendChild(formelem); 
           
           formelem.submit(); 
           document.body.removeChild(formelem); 
           } 


     
  2. Create an activity as a wrapper to MSOGenerateExcel
  3. Pass the required parameters
  4. Invoke the function mentioned in Line1 of the runscript on click of a button


 

Root Cause



An issue in the custom application code or rules. The user code is incorrect which causes the Autocomplete to be unresponsive after the Form Submit operation. 

Resolution



Perform the following local-change:
Use the below script:


 function downloadMSExcel(fsFileName, templateRFB, downloadFile ){ 
       var form = document.createElement('form'); 
       form.id = "formExportViewToExcel"; 
       form.method = "POST"; 
       form.target = "_target"; 
       document.body.appendChild(form); 
       var frm = document.forms["formExportViewToExcel"]; 
       var strUrlSF = SafeURL_createFromURL(pega.u.d.url); 
       strUrlSF.put("pyActivity", "Generateexcel"); 
       strUrlSF.put("FSFileName", fsFileName); 
       strUrlSF.put("TemplateRFB", templateRFB); 
       strUrlSF.put("DownloadFile", downloadFile); 
       frm.action = strUrlSF.toURL(); 
       frm.submit(); 
       document.body.removeChild(form); 
       } 

 

 

Suggest Edit

Published January 13, 2020 - Updated December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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