I am loading a canvas app on a VF page from a custom button. The flow is : button click from detail page -> Validation page -> Vf page with canvas app.

From vf page with canvas, whenever I press back button in SF1 ios or physical back button on android phone, I want to redirect back to detail page instead of validation page. Is there any way to override back functionality on SF1.?

1 Answer 1


Here is a description of sforce.one navigation functions

You need to use the navigateToURL(​url​[, isredirect]) function what you need to do: on the validation page you need to place the following script:

if (typeof sforce !== 'undefined') {
    sforce.one.navigateToURL(yourUrl, true);

The main point is to use the second argument in the navigateToUrl call.

The salesforce doc says the following:

isredirect is optional and defaults to false. Set it to true to indicate that the new URL should replace the current one in the navigation history.

So, when you go back to the detail page, the SF1 history will ignore the validation page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.