Support Article
Visibility When rule and Section Refresh do not work
SA-88050
Summary
A section is configured such that an auto refresh invokes an activity.
In the activity, a SOAP Service is invoked. Based on the response, the value of a flag is set. Based on value of the flag, the Visibility When condition of some layouts is set. During auto refresh, the Visibility When condition is executed as True; however, the section is not refreshed and the layout is not visible.
Error Messages
Not Applicable
Steps to Reproduce
- Configure a section with the script in the HTML source to auto refresh the parent section.
- Refer this Section rule in a different section.
- In the parent section, refer the layouts with Visibility conditions.
- In the auto-refresh activity, set the flag such that the Visibility condition of the layout is true. After the auto-refresh activity is executed, the Visibility When condition is true in the Tracer, however, the section is not refreshed and the layout is not visible.
Root Cause
An issue in the custom application code or rules: User configuration.
The below script is referred in the auto-refresh section which does not work:
<script>
$(document).ready(
function(){
setTimeout(
function(){
pega.u.d.reloadSection(pega.u.d.getSectionByName("ServiceActions", "", ""), "ErrorAutoRefresh", "" , false, true, -1, false, event);
},
15000);
return(false);
}
);
</script>
Resolution
Perform the following local-change:
Use the below script in the auto-refresh section as suggested in the JavaScript API documentation:
<script>
$(document).ready(
function(){
setTimeout(
function(){
pega.api.ui.actions.refreshSection({
section:"ServiceActions",
submitOnRefresh:false,
activity:{
name: "MeigasAutoRefresh"
}
});
}
,15000);
}
</script>
Published December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.