Support Article
Control is not calling activity and event sequencially
SA-3526
Summary
When a using a user created a control for calling an activity and close event via a Modal dialog, the order of the two events isn't always as defined in the control's javascript (observed in tracer and log events). The control appears to call activity first and then call the Event, but sometimes the order switched.
Error Messages
N/A
Steps to Reproduce
- Create one Modal Dialog window
- Create button in Modal Dialog window
- Call control from that button
<script>
function RunActLoad(){
handleClientEvent ('SERVER','LoadRequirementList','','-1',event);
RunActLoads();
}
function RunActLoads(){
doModalAction(pega.u.d.submitModalDlgParam,event);
}
</script>
<!-- simple HTML button definition
<input type="button" onclick="RunActLoad()" value="Done" />
-->
<!-- PEGA L&F button definition -->
<NOBR>
<BUTTON class=pzhc onclick="RunActLoad()" >
<DIV class=pzbtn-lft>
<DIV class=pzbtn-rgt>
<DIV class=pzbtn-mid data-click="...">
<IMG class=pzbtn-i>Done
</DIV>
</DIV>
</DIV>
</BUTTON>
</NOBR>
<pega:reference name="$save(BUTTON-caption)" />
Root Cause
The root cause of this problem is a defect in customer application code/rules. The user defined function launches an asynchronous activity which the system doesn't wait to be completed prior to proceeding.
Resolution
The explanation for this behavior is as follows:
The user defined function launches an asynchronous activity which the system doesn't wait to be completed prior to proceeding.
Published January 31, 2016 - 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.