Return user to Skuid screen after sending email

  • 1
  • Question
  • Updated 3 years ago
When directing a user from a Skuid screen to the SF send email screen you can redirect the user back to the Skuid screen if Cancel is selected with this URL script:

" /_ui/core/email/author/EmailAuthor?p2_lkid={{{$Model.Case.data.0.ContactId}}}&p3_mlktp=500&p3_lkid={{{$Model.Case.data.0.Id}}}&retURL=/apex/ui?page=GBC_Case_View%26id%3D{{$Model.Case.data.0.Id}}"

BUT


When the user selects send then SF directs you to the Object record view and ignores any retURL command!

Is there a way to redirect the user back to a Skuid page after the user selects Send Email?

Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
  • befuddled

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
That would be slick. I've been forcing the email to open in a new window, and encouraging users to close the window after the email sends. Perhaps there's a way to have the window close automatically after send?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
It looks to me like the "saveURL" parameter works with the email composer tool.   Your url redirect code would look somthing like this: 

/_ui/core/email/author/EmailAuthor?p2_lkid={{{$Model.Case.data.0.ContactId}}}&p3_mlktp=500&p3_lkid={{{$Model.Case.data.0.Id}}}&retURL=%2Fapex%2Fui%3Fpage%3DGBC_Case_View%2526id%253D{{$Model.Case.data.0.Id}}&saveURL=URLEncoded_Page_Destination

Note.  You have not URL encoded the full link for your RetUrl above,  which will cause things to break.  I'm guessing that the RetURL in your email page is not what you expect.   Take the address you want to send the user to (in a retURL or a saveURL and go to http://meyerweb.com/eric/tools/dencoder/  to get an encoded version.  
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hey Rob.  Thanks a ton.  I was missing the &saveURL piece :-)

The script now looks like this:
/_ui/core/email/author/EmailAuthor?p2_lkid={{{$Model.Case.data.0.ContactId}}}&p3_mlktp=500&p3_lkid={{{$Model.Case.data.0.Id}}}&retURL=%2Fapex%2Fskuid__ui?page=GBC_Case_View%26id%3D{{$Model.Case.data.0.Id}}&saveURL=%2Fapex%2Fskuid__ui?page=GBC_Case_View%26id%3D{{$Model.Case.data.0.Id}}