Can you redirect to the previous page after a save or cancel?

I am wondering if the page you redirect to after a save or cancel can be set to “whatever page was before this one”. 

Use case – 

My users often use their task list (a modified version of the home page) to work through their tasks. E.g, 

  • Start at task list on hompepage
  • Click on task name to navigate to task detail page
  • Edit, complete, save task
  • Go back to task list on homepage
  • Begin again
However sometimes they may be working on a specific contact with multiple operations: 
  • Start on contact detail page
  • create new follow up task
  • Go back to contact detail page to do something else
In both cases the user wants to go back to the page they were before the task page to continue doing something. But the page title component only lets me put a single URL, albeit one with dynamic tokens. 

Is there a token for “page that was before this one”? 

Thanks! 

How is the page you’re redirecting from being navigated? Can you pass a URL parameter into the page to use as your redirect ID?

“/{{$Param.redirId}}”

Great idea…not sure whether I can control the URL though. 

The tasks are most often being navigated to from a table of tasks. Either a table on the homepage (global task list) or an “open tasks” table on the contact detail. 

Not sure if there is a way to insert this parameter into the task name URL that’s generated within the table? 

Well. Hmmmm … you can control it sometimes. You are creating new tasks and then wanting to come back to the original record that the user clicked from to create the task. What are you using to get to the “NewTask” page? Row Action, Button, javascript?

Pat, you’re right. I realized I misstated the second scenario in my original post. The workflow would be more like, 

  • Start on contact detail page
  • navigate to existing task from the open tasks list
  • Edit, close, save task
  • Go back to contact detail page to do something else
So when creating new tasks I have control but the challenge seems to be when accessing existing tasks from the activity list that is either global or specific to a contact and wanting to go back to the original page. 

Wait, I’m missing the obvious.

The Task is related to the record you’d like to navigate back to.

“/{{What}}” or “/{{Who}}”

Using mustache you can insert the correct one in the redirect.
{{#What}}/{{What}}{{/What}}
{{#Who}}/{{Who}}{{/Who}}


So unfortunately the two pages I want to redirect to would be either 

/{{who}} OR /home.jsp

But would want it to be smart enough to know which one was the referring page and go back there. That’s why I wondered if there was a token for “last page before this one or something similar”

Oh. sometimes from the home page. I see. hmmmm … I’m sure you can get the browser history, but I’m not sure to do that myself.

Use a javascript snippet with the following content:

window.history.back();

See… javascript. Can’t wait til it comes to me that easily. A one liner snippet!

I sometimes feel as though I’m playing t-ball and wildly swinging the bat way too high over and over …  :( It’s really hard to miss in t-ball for anyone with arms.

I’m still typing with my nose. :stuck_out_tongue:

@Moshe, that is awesome – thanks!

Just to clarify, would I leave the “redirect after save” field in the page title blank, and then for the save button, run multiple actions that would first save the model, then call the javascript snippet? 

Thanks again. 

Your clarification is correct.  Use a multiple actions sequence for the button…