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
subaasubaa 

URL Encode

Hi,

 

I have to launch other application from Account detail page, when a custom button clicked on. In the background i have to build the URL dynamically by including multi picklist values for a query string and each optional values separated by '|' operator. When i test the button click logic, the generated URL consist of encoded value for '|' operator which doesn't supported by the target application. Can anyone help me to build the URL as it is.

 

Regards,

SuBaa 

HaagenHaagen

Hi Subaa,

 

I'm not sure I understand where your button is but couldn't you use the URLENCODE method when creating the button?

 

URLENCODE(text)

Encodes text and merge field values for use in URLs

 

Martin

subaasubaa

Hi Martin,

 

Thanks for your reply. This is my target URL "

?doSearch=true&typeName=re_company_file&attrName=company_group_number,category

&attrValues=XXXX,Macro%20View|People|Relationship%20Management|Correspondence", where i have to build the portion 'XXXX,Macro%20View|People|Relationship%20Management|Correspondence' dynamically. Here the values separated by | operator are user's options. When i try to concatenate user selected optional values with | operator, the resulted URL shows '&#124' for each | operator. If i use URLENCODE method while concatenating special character, URL shows '%7C' for | operator and '%2C' for comma operator.

 

How do i resolve this issue.

Regards,

SuBaa

HaagenHaagen

Hi Subaa,

 

it looks like parts of your string is allready URLENCODED. And then URLENCODING it again will probably screw thing up. What happends if you instead of delimetering with | using %7C instead (but still use | on the other side)? 

 

Cheers!

 

Martin

subaasubaa

Martin,

 

You are right. PageReference object will do the URL encode automatically, when the constructor with URL param string called. So I just removed the explicit URLENCODE method call from my controller and tested. It is working fine now.

 

It would be appreciated If you explain me (or refer any link for) the scenarios where URLENCODE/URLDECODE methods used explicitly.

 

Regards,

SuBaa