You need to sign in to do that
Don't have an account?
Alex Yhap
Merged fields with parameters in Custom Button
I have a Custom Button:
That is passed this value Conga_Solution_URL__c:
Which is results in:
As you can see the text is being encoded which I do not want. "&" is being converted to "%26" and "=" is to "%3D". I DO NOT want this action to occur...
How do I prevent the merged field from being html encoded?
Thanks
https://workflow.congamerge.com ?SessionId={!API.Session_ID} &ServerUrl={!API.Partner_Server_URL_80} {!causeview__Receipt__c.Conga_Solution_URL__c} &DS7=12 &BML=Sending+Receipt+For:+{!causeview__Receipt__c.causeview__Constituent__c}
That is passed this value Conga_Solution_URL__c:
&id=a0qq0000000gQue&EmailToId=003q000000J9l8S&CongaEmailTemplateId=a1Uq00000002E42&templateId=a1Wq00000001baX&FP0=1&LG3=1&AC0=1&SC0=1&SC1=Attachments&QMode=SendEmail
Which is results in:
https://workflow.congamerge.com/composer8/index.html?SessionId=00Dq0000000B2gd%21ARgAQEjKPP.PA2DmTqONE9W3qyo.yAhg0kqHWWIadleiv6Ww_0g7C7PSl7TON8j4as1J9K06SXbJx_rDqFamoW7lFh7XTQn1&ServerUrl=https%3A%2F%2Fcs21.salesforce.com%2Fservices%2FSoap%2Fu%2F8.0%2F00Dq0000000B2gd%26id%3Da0qq0000000gQue%26EmailToId%3D003q000000J9l8S%26CongaEmailTemplateId%3Da1Uq00000002E42%26templateId%3Da1Wq00000001baX%26FP0%3D1%26LG3%3D1%26AC0%3D1%26SC0%3D1%26SC1%3DAttachments%26QMode%3DSendEmail&DS7=12&BML=Sending+Receipt+For:+Alexander+Yhap
As you can see the text is being encoded which I do not want. "&" is being converted to "%26" and "=" is to "%3D". I DO NOT want this action to occur...
How do I prevent the merged field from being html encoded?
Thanks
All Answers
{!JSENCODE(causeview__Receipt__c.Conga_Solution_URL__c)}
(on both merge fields)
Hopefully the JSENCODE method will make the render return an already safe string and thus won't be encoded (or it might just exacerbate the problem, thinking about it.. I might try it out in a dev edition for you as well!)
All the info on encoding is kind of here:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_security_tips_scontrols.htm
There is no scenario in which a string is already basically encoded. Let me think about this. it might be you need to create a second custom field and do a bit of processing to make it more suited for inclusion in a custom button?
Does this happen when you both run it as a URL and a onClick type?