Question

Managing the back and the next button of the browser

Hi,

My Pega solution proposes a screen flow that is interrupted by the user as soon as he presses the back / next button from his browser or from the keyboard. As a result, data become stale and the message "This action is not allowed as it is outside the current transaction." is getting displayed. 

I can't prevent my users to use the functionnality of their web browser. However, is there a way to "replace" the back/next feature by a refresh, which would prevent the flow from an unexpected behavior?

Regards

***Updated by moderator: Lochan to add Categories***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

October 7, 2016 - 7:41am

You can google for disabling back n forward button for browser, a JavaScript code which u can include in harness rule.

October 7, 2016 - 9:31am

Hi DharanitharanR,

I read that sadly, this practice was strongly not recommended for some reasons, like having different behaviors on different browsers. I was more looking for a solution to implement with pega tools (even if I know that controlling the browser for such a request is not directly possible for now with pega).

However, maybe was it a possibility to manage the case where the user press the back button during a flow, or a possibility to replace the navigation using the browser (back/next button) by a refresh when its applied to pega?

December 29, 2016 - 11:08am

Hi, 

To disable back button, Use this code

  1. history.pushState(null, null, document.URL);
  2. window.addEventListener('popstate', function () {
  3. history.pushState(null, null, document.URL);
  4. });