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
Raksha NarayanRaksha Narayan 

unable to get hyperlink in SOQL query

On Account record I have a text field that contains value as 'Click here' where 'here' is a hyperlink to On querying the field using SOQL, I am getting the value as 'Click <a href=""> here</a>'
But I want to get the value as 'Click here' instead of href. Is it possible? Please suggest if it can be achieved by any other method.
AbhinavAbhinav (Salesforce Developers) 
Hi ,

Have you tried suggestion provided in below link?

Raksha NarayanRaksha Narayan
Hi Abhinav,
In my case I am not using formula field. i am updating the value from apex class through SOQL query. Is hthere a way to get the text instead of href?
mukesh guptamukesh gupta
Hi Abhinav,

you need to create  HTML Rich area text field

caseRichtextField__c= '<a href="">Click Here</a>'

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Raksha NarayanRaksha Narayan
Hi Mukesh,
I tried the rich text field but it is giving the result as "<pre> &lt;a href=&quot;;&gt;Click Here&lt;/a&gt;</pre>" instead of hyperlink
Suraj Tripathi 47Suraj Tripathi 47
Hi Raksha Narayan

what you want and what you are doing is different to get the URL field you can new field returning only that value. 

If you find your solution mark this as the best answer.

Thank you!
Suraj Tripathi
Josh MorganJosh Morgan
I am updating the value from the apex class through SOQL query. Is there a way to get the text instead of href?
Veronin SkadvizVeronin Skadviz
I found the same issue with GameGuardian. not yet figured out how to overcome that