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
svdsvd 

Escape Single quote in Visualforce

I'm having issue in escaping a single quote in VisualForce page.

In my output label, I used

{!IF($Profile.Name=="Customer Portal User","My Open Service Requests","Company\'s Open Service Requests")}

 

The output on my VF page is Company\'s Open Service Requests. Its not escaping the single quote. 

 

I also tried "Company\'\'s Open Service Requests".

 

Thanks in advance for the help.

colemabcolemab

Will this not work:

"

 

Ghanshyam Kumar 9Ghanshyam Kumar 9

Instead of single Quote you can write '
It will show single quote on visual force page and will not hamper your other code also.

I have used it. It is working fine.

salesforceapexsalesforceapex
Does anyone get the resolution for this? I have the same issue when formatting the value for the "Subject" attribute in VF Email template messaging:emailTemplate. Could anyone please help.