How to make button with JS: window.history.back(); ?

How to make button with JS: window.history.back(); ?

  

I have 1 common detail screen which can be called in 3 separate screen (namely List Screen, Approve Screen, Audit Screen), which both called this 1 common detail screen.

I want to make a Back/Cancel button, that navigate to previous screen.

In Destination property there is no previous screen option.

How can / should I make a javascript history back button to achieve this?

Thanks.

Hi Harlin,

One possibility is to pass the "previous" page as input parameter and on "back" just "navigate" to it.

Or,

You can have a link/button that navigates to the page itself "#" and add an OnClick event (extended properties) that runs your javascript to go back.

You can even add HTML through expression and set your link/button directly (but usually is not good practice to include html directly).

<button onclick="goBack()">Go Back</button>

<script>
function goBack() {
    window.history.back();
}
</script>

Hope this helps.

Cheers,
Eduardo Jauch