Support Article

Action is not allowed as it is outside the current transaction

SA-25409

Summary



Users see the message "This action is not allowed as it is outside the current transaction" when they click Wrap Up.

 The logs show a corresponding error message.


Error Messages



 ERROR: posted transaction id 'f45a765cf9f99fa286257679d4a04f8a' for frame 'pyWorkPage' DOES NOT match record 'f6f638f2454a17447c1e11f2ac93844d


STEPS TO REPRODUE

  1. From the Composite Portal, which is open to the Account Tab, click the Summary tab.
  2. Rapidly move to the Wrap Up button and double-click the button.

Root Cause



A defect in Pegasystems’ code or rules
The timings involved delay the processing of the first click so that the user has time to make the second click. The architecture of the button is such that both a single-click and double-click handler are present on the action; however, this is not a recommended design and is unlikely to work in all situations. In the out-of-the-box system, if Fiddler is used to slow things down to Modem speeds, the error message almost always occurs because the button single-click action fires twice. Or the single-click AND double-click action fires twice. The second FinishAssignment fails because the transaction ID is changed by the first.

Resolution



Perform the following local-change to eliminate the double-click action and leave only the single-click action.

Add an action to run the script "singleClick" as the first action of the sequence as shown here:


Add an action to run the script "singleClick"

The large integer number as the parameter passed is taken from the General tab of the control as shown here:


General Identifiers Test ID

This number will change every time the Generate ID button is clicked. After implementing this local change, if the ID is changed, one must update the function call in the action section by passing the new value as the parameter to "singleClick".

In UserWorkForm, add the following script:

<script>
 singleClick = function(theButtonID) { 

/*build the search string */
 var buttonID = "[data-test-id= " + theButtonID + "]";

  var theButtonObject = $(document).find(buttonID);
  
  /*if we find the button, disable it if still ative; else clear the queue and stop processing actions */
  
   if (theButtonObject != null) {
  
    if (true != theButtonObject.prop("disabled")) {
            theButtonObject.prop("disabled",true);
    }
    else  
       pega.control.actionSequencer.clearQueue();
   }

  
}

;
</script>

During the processing of the action set for the first click, the button is marked disabled, but the action set will proceed to completion. Even though the button is now disabled, there will still be additional click events that have already queued up for processing. For each of those queued events (and there are as many as three actions queued up), user detects that the button has been disabled and abort the processing of the second and subsequent events.

Since the Wrap Up button is tossed after the first action set completes, there is no need to have to re-enable the button after the duplicate events in the queue are purged.

If your system contains the When rule pzEnableTestID, then it is necessary for users to have the privilege pxTestID for the local change to function properly. The only effect of this privilege is to allow the creation of IDs on the DOM element so that the local change can find the proper button.

Published July 8, 2016 - Updated September 9, 2016


100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.