function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric BollerEric Boller 

Left Voicemail Button...redirect issue

{!requireScript("/soap/ajax/24.0/connection.js")} var lead = new sforce.SObject("Lead"); lead.Id = "{!Lead.Id}"; lead.Status = "Left VM - Email"; result = sforce.connection.update([lead]); if (result[0].getBoolean("success")) { window.parent.location.href = "/00T/e?followup=1&title=Call$retURL=%2F{!Lead.Id}&who_id= {!Lead.Id}&tsk5=Left+Voicemail&tsk6=Left+a+voicemail+for+{!Lead.Name}&tsk5_fu=FU+VM+w+ {!Lead.Name}+from+{!Lead.Company}&tsk4_fu={!TODAY()+2}";} else { alert("failed to update lead " + result[0]); }

I have the above custom button for leads. It allows reps to click the button, change the status, and create pre-populated tasks.
 

My question is, after save, is clicked on the task, it redirects to the user's home page. How can I make it redirect back to the lead?

Best Answer chosen by Eric Boller
Brian FordBrian Ford
There's a typo in your URL. You're using a dollar sign instead of ampersand before retURL.

&title=Call&retURL=%2F{!Lead.Id}&

All Answers

Brian FordBrian Ford
There's a typo in your URL. You're using a dollar sign instead of ampersand before retURL.

&title=Call&retURL=%2F{!Lead.Id}&

This was selected as the best answer
Eric BollerEric Boller
Perfect, thank you!