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
OldDeadBugOldDeadBug 

'&' appears as '&amp' when sending Opportunity Name to a web form via custom button

I am creating a custom button to send Opportunity data to submit a form on a non-Salesforce website.

 

In my test case the Opportunity Name has an ampersand (&) in the name.

 

It doesn't seem to matter if I use

ProjectName = {!Opportunity.Name}   or

 

ProjectName = {!URLENCODE(Opportunity.Name)}

 

In either case the name is still appearing with '&amp' in the name rather than just the '&' symbol. 

 

I can't really tell if the code managing the web form is causing the problem, or if I'm still not writing the Merge Code correctly.

 

If it is the web form that is resetting the '&' value, then I guess I'll have to create a formula field that removes special characters and send that instead, but if there is some other way, or some other reason this might be happening, I'd appreciate any help

 

Thanks

Navatar_DbSupNavatar_DbSup

Hi,

 

You can replace ‘&’ with ‘&’ in your controller

 

 

Fieldname.replace(’ &’,’&’);

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.