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
andy_candy_c 

URL encoding of Salesforce Merge fields

I would like to include some Salesforce.com merge fields e.g. {!Account_Name} in to a URL but cannot find out whether they are encoded (so spaces are catered for etc.). Can anyone help..?

Thanks
DevAngelDevAngel

Hi any_c,

They are url encoded.

andy_candy_c
Hi - thanks for the reply. Most of the fields are fine apart from those that are text fields. For example: If I include the field Account Name in to a URL and I have an Account Name of "ABC Inc" the URL splits at the space...

I need to 'encode' all the spaces so they don't break the URL.

Thanks
NickPRNickPR
i am also after a solution to this same problem.
Ron HessRon Hess

i use "%20" to hold the position of a space when I'm constructing a URL which I will pass into a browser

also %0D will hold a newline