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
bottsbotts 

Need Help with Email Button Code

I created an email button in a custom object which works fine, except when I click on send or cancel, it does not loop back to the previous page ie the custom object. 

 

Here is the code:  

 

location.replace('/email/author/emailauthor.jsp?retURL=/{!Gift_Requests__c.Name}&p3_lkid={!Gift_Requests__c.Id}&rtype=003&p4={!Opportunity.OwnerEmail}&p2_lkid=0037000000g3KpE&template_id= 00X700000017qEN ');

 

Can someone tell me what's missing so when the user clicks on cancel or send it loops back to the custom object.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf

Should be

 

retURL=/{!Gift_Requests__c.Id}

All Answers

werewolfwerewolf

Should be

 

retURL=/{!Gift_Requests__c.Id}

This was selected as the best answer
bottsbotts
Awesome, it worked THANKS!