You need to sign in to do that
Don't have an account?

Custom Email Button on Lead page.
Code:-
location.replace('/email/author/emailauthor.jsp?retURL=/{!Lead.Id}&p3_lkid={!Lead.Email}&rtype=00Q&p2_lkid={!Lead.Id}&template_id=00XA0000000RfyB&p5=&save=1');
Error:-
The value of the "p3_lkid" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
p3_lkid={!Lead.Email} should be id and not email.Please check link below for more clarification.
https://success.salesforce.com/answers?id=90630000000gtNyAAI
example
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=<your template here>');
Also save=1 is no more supported by Salesforce. Please let me know if its working for you.
Best Regards,
Rahul
Hi Rahul,
Even though I changed the code to following:-
location.replace('/email/author/emailauthor.jsp?retURL=/{!Lead.Id}&p3_lkid={!Lead.Id}&rtype=00Q&p2_lkid={!Lead.Email}&template_id=00XA0000000RfyB&p5=');
I get similar error.
And the link you sent me, it is from there I picked the syntax.
Do I need to do more coding??
What all I am trying to do is; create a custom button in Lead object and select "Execute on Javascript" and place the above lines in that editor mode area and save it.
And I have added that custom Email Button in Lead detail view. When I click the Email button it should fetch Email value from Email field and send mail to the following Email Id. About p2_lkid; I am getting the value of Email Id in it.
For now, even when I put the Id of the specific record in p3_lkid I get the similar error.
This is how, I have done it:-
location.replace('/email/author/emailauthor.jsp?retURL=/{!Lead.Id}&p3_lkid=00Q9000000kXlnK&rtype=00Q&p2_lkid={!Lead.Email}&template_id=00XA0000000RfyB&p5=');
It doesnot work either. Same error. Thank you for your help.
I would better try using Vfpage custom controller.