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
- 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);
}
- Create an activity as a wrapper to MSOGenerateExcel
- Pass the required parameters
- 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);
}
Published January 13, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.