Support Article
pxCaseMgrScript JavaScript does not work with a Screen layout
SA-75623
Summary
pxCaseMgrScript is used in the Scripts and Style tab of the harness which has a panel set in it. With the panel set, the review panel expands onClick of any record in the grid. However, when the panel set is converted to a screen layout, the script does not work.
Error Messages
Error in browser console:
Cannot read property 'layoutObj' of null.
Steps to Reproduce
- Create a harness.
- Add a Footer screen layout with a grid.
- Add the pxCaseMgrScript script in the Script and Style tab.
Root Cause
A backwards compatibility defect in Pegasystems’ code or rules.
The pyCMCases and pxCaseMgrScript sections were designed earlier and support minimum features with some limitations.
Resolution
Perform the following local-change:
Use a custom script file in the pyCMCases harness' Scripts and Styles tab to set the footer height.
Replace this code:
if (pega.util.Dom.isAncestor(gridDiv, target)) {
pega.u.d.portal.layoutObj.getUnitByPosition('bottom').expand();
}
with the below code.
if (pega.util.Dom.isAncestor(gridDiv, target)) {
$("footer").css("height","200px");
$("footer").css("background-color","#D6E2F5");
}
Published March 29, 2019 - 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.