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

'&' appears as '&' 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 '&' 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
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.