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
Lomash RegmiLomash Regmi 

Display a field without label, next to another field.

I have a custom object with default page layout. This object has 4 phone numbers.
My requirement is one of the numbers needs (*) beside it to denote preferred phone number.

eg:

home cell phone 362-589-5968 (*)            work cell phone 489-652-6954
home landline phone 563-965-5231          work desk phone 456-895-8954


I have a picklist where user chooses their preferred number. It could be home cell, work desk, etc.
Now I want to use that information to put star beside the right number.

I created a formula field to display (*), and added it to page layout. But this approach doesn't work for me because it displays its own field label, and is placed separate from the phone number, like this:

Preferred Phone (*)

How can I do this so that label is suppressed and (*) displays on the side of phone number?

Thank you!
venkat-Dvenkat-D
The solution that will work for you (i am not saying efficient ) is 
Create 4 formula fields with same label as above fields. 
sample formula : 

IF(ISPICKVAL(Preferred__c,"Home cell"),home cellfield +"(*)" , home cellfield )

similarly create all 3 formula fields, remove above fields and add formula fields to the layout. 

This is exact solution for what you need without analysing any further impact.
Lomash RegmiLomash Regmi
Thank you for that suggestion. I thought about that, but as you said, it may not be an effecient solution. It requires to have 2 fields for each phone number: One to store phone number, another just for the display.

Another option is to write a trigger for 'before insert' and 'before update'. This trigger will append (*) to the preferred phone number. But that is also not a good idea because it requires storing unrelated text (*) in a phone number field. If user changes preferred phone number later, the old field's unneeded (*) would have to be removed also.

Is there any visualforce solution to affect an individual field, located inside a default page layout? I think that would be an elegent solution for this.
venkat-Dvenkat-D
Even though you are storing unrelated text in the field trigger makes sense.