2012
Views
2
Comments
How to make button with JS: window.history.back(); ?
Question

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.

2020-02-28 09-46-54
Eduardo Jauch

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

UserImage.jpg
Gaurav Pandey

Hello!

I am facing issues while navigating through back button.

I have used javascript (windows.history.back) for navigation. It is working perfectly for desktop view but for mobile view,It is not working at all.What all options do I have to fix this navigational issue.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.