I have a custom list form in SharePoint Online 2013 which after validating using the PreSave() function displays a modal dialog giving the user a choice of two outcomes. This works fine and the user is returned to the lists's AllItems.aspx page.
What I would like to do is return the user to the site's Home Page and have tried to achieve this by using the following code:
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(saveButtonName, "", true, "", "https://[mydomain].sharepoint.com/sites/dev/SitePages/Home%20Page.aspx", false, true));
The url is valid, and redirects correctly, but I am returned with a SharePoint error:
Sorry, something went wrong
This Page has been modified since you opened it. You must open the page again.
Is there a way to overcome this issue or should I be using another way to skin this particular cat?