Hi stackexchange community.

I have noticed that the e-mail template i've been using somehow cuts the rest of the address in "Additional To" field, if it contains "&" sign (e.g. test&test@gmail.com will look like "test" in the template).

I have a field in my Account page, which is the email address, and this is the javascript code for the button:


var account = new sforce.SObject("Account"); 

account.id = "{!Account.Id}"; 

if ("{!Account.Obj1__c}" == "Yes") 


I'd really appreciate if you could advise me how to deal with this issue.

Thanks in advance and best regards


I am going to go out on a limb and assume the custom field you are talking about is Account.Obj1_email__c and Account.Obj2_email__c, and the input for your form is ...&p24={!Account.Obj2_Email__c}&retURL...

When building a URL, there are several reserved characters for different purposes. the & character is a parameter deliminator.

Because you are not escaping the & in the email address, it is assigning what comes before it to p24 and then creating a new parameter with what ever comes after.

I think you simply need to URLENCODE() the email address, and you will see what you are expecting

| improve this answer | |
  • Hi Tezyn! Thank you for your answer! Your assumption re field names is correct. Also, the e-mail field is based on customers name, so it's not a direct input, but a formula, like IF(Current_Customer__r.Name = "Test", "test&test@gmail.com",. Re your suggestion, i'm not really sure how can i do that. Shall i update the e-mail field formula to IF(Current_Customer__r.Name = "Test", URLENCODE("test&test@gmail.com"),? Or do i need to update &p24={!Account.Obj2_Email__c} to &p24=URLENCODE({!Account.Obj2_Email__c}). Thank you in advance for your help – Echo_2 Feb 6 '15 at 13:11
  • &p24={!URLENCODE(Account.Obj2_Email__c)} Be sure to also change the reference to Account.Obj1_Email__c in the lines above. – Tezyn Feb 6 '15 at 13:25
  • Hi Tezyn, it worked like a charm! Thank you so much for helping me out! – Echo_2 Feb 6 '15 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.