Save redirect when using save and stay

Forums General discussion Save redirect when using save and stay

Viewing 4 reply threads
  • Author
    Posts
    • #27682
      John Garrido
      Participant

      Hi Alex,
      Do you have an example of saving the edit form and staying open, but then allowing redirect to the home page when the user clicks save. My form is redirecting to the home page when either button is clicked.
      Thanks!

    • #27710
      Alexander Bautz
      Keymaster

      Have you looked at the Save and redirect settings in the Misc tab?

      Alexander

    • #27712
      John Garrido
      Participant

      I am probably misunderstanding how it works. On the misc tab under ‘When saving the list item in EditForm’ I am selecting ‘Keep the EditForm open’ and calling the new button ‘Save and Stay’. This works as intended until I add spjs.dffs.redirect(“TheRedirectURL”,false) to the dffs_PreSaveAction. I am adding spjs.dffs.redirect(“TheRedirectURL”,false) to get the native ‘Save’ button to have a custom redirect.

    • #27717
      Alexander Bautz
      Keymaster

      When you do it like this, the one in dffs_PreSaveAction will always win.

      I haven’t really thought about this, but you can do it by adding this snippet to your dffs_PreSaveAction function:

      if(window.top.DFFS_redirectInfo === undefined && typeof _oSTSNavigate === "undefined"){
              // The form is NOT saved with the Save and Stay button and you have NOT used the spjs.dffs.redirect above this line
              spjs.dffs.redirect("ADD_YOUR_REDIR_URL_HERE",false);
          }

      Alexander

    • #27719
      John Garrido
      Participant

      Thanks Alex! Exactly what I needed.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.