Support Article
ActionAutoSubmit HTML does not work
SA-40081
Summary
Auto submit functionality that uses the out-of-the-box ActionAutoSubmit HTML fragment in a flow action, generates an error in Internet Explorer (IE) browser.
Error Messages
This action is not allowed as it is outside the current transaction.
Steps to Reproduce
- Add ActionAutoSubmit HTML in a flow action
- Execute the flow in IE
Root Cause
An issue in the custom application code or rules. Using out-of-the-box ActionAutoSubmit HTML fragment is deprecated for a flow action. Additionally, in IE browser, the scripts and the CSS take additional time to load and before the screen is rendered completely, the autosubmit action is triggered as it is used in the flow action.
Resolution
Perform the following local-change:
Create a new HTML rule with the below script and use this in the flow action:
<SCRIPT>
var doActionAutoSubmit = function(){
setTimeout(function(){
doSubmit();
},2000);
pega.u.d.detachOnload(doActionAutoSubmit);
}
<%
String strMessages = tools.getPrimaryPage().getMessagesAll();
if(strMessages.length() == 0)
{
tools.appendString("if(window.name != null && typeof(window.name) != \"undefined\" && window.name == \"actionIFrame\" ){");
tools.appendString("pega.util.Event.addListener(window,\"load\",doSubmit);");
tools.appendString("}else{");
/*BUG-168564: Updated doSubmit to call after loading all files. */
tools.appendString("pega.u.d.attachOnload(doActionAutoSubmit, true);}");
}
%>
</SCRIPT>
Published August 4, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.