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
shravani milshravani mil 

Font Color and Bonding

I have a field AccountLookup that must be a hyperlink and it should be in font colour and bolding.can any one suggest how to acheive this.
Yury BondarauYury Bondarau

Hi Sharavani,

In case you want to apply some styles on standard salesforce layouts it is not easy and strongly NOT recommended.

You can use VF page to apply any css-styles you want.
Also you can use formula field to display something clickable or even display an image (but html markup is not allowed in formulas)

shravani milshravani mil
Hi yury can you please specify sample vf page with hyperlink and color
Abhishek Vishwakarma 5Abhishek Vishwakarma 5
Hi shravani,

I guess you want something like this.
Visualforce Page::

<apex:page Controller="MyCustomLookupController">
<style>
    .account{
        font-weight: bold;
    }
   a{
       color: #F80C0C;
    }

</style>
  <apex:form >
  <div class="account">
     <apex:outputField styleClass="account" id="Account" value="{!contact.AccountId}"/>
  </div>
  </apex:form>
</apex:page>

Apex Class::

public with sharing class MyCustomLookupController {

  public Contact contact {get;set;}

  public MyCustomLookupController() {
    contact = [Select AccountId, Name from Contact Limit 1];
  }

}


You can change the outputfield to the field you have.. suppose that link doesnt work than you can replace with the below one inside the <  /> ::

<a href="#"> {!salesforce field}</a>

Output
Hope this will help you.

Thanks,
Abhishek

shravani milshravani mil
Hi Abhishek i want the above one in a formula field.
Abhishek Vishwakarma 5Abhishek Vishwakarma 5

Hi shravani,

You can refer your formula field inside the <div> element in the VF Page.

<div>
<formula field>
</div>
However,you cant display in Standard Page. For more specific way or I can say other option, yo can also use Image inside the Formula Field.
IMAGE("/servlet/servlet.FileDownload?file=01570000000Q6Ep", "Red")

Hope this will resolve your Issue.

Thanks,
Abhishek