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
AnonymouseAnonymouse 

How to Get Name Id WhoId to Show as Name Instead of Id

Hello,

I am currently working on a process builder. I have a formula field that is the concatenation of two fields. One of the fields is a Name Id (WhoId). How may I get the Name to show up as a name instead of as an Id?
[Task].Subject + " - " + [Task].WhoId
Any help would be greatly appreciated.

Sincerely,
Anon
NagendraNagendra (Salesforce Developers) 
Hi,

This can be achieved easily using basic programming.

Here is a code sample:

Use Who.Name in your query:
<apex:page controller="checkwhocontroller" >
<apex:pageBlock>
<apex:pageBlocktable value="{!mywho}" var="w">
  <apex:column width="400px">
                  <apex:facet name="header">Name</apex:facet>
                   <apex:outputLink value="/{!w.whoid}" >
                           <apex:outputText value="{!w.who.name}"/>
                   </apex:outputLink>  
        </apex:column>
        </apex:pageBlocktable>
</apex:pageBlock>
</apex:page>


public class checkwhocontroller {

    public Task[] getMywho() {
    task[] mytask = new task[]{};
    mytask=[SELECT Subject, Who.Name FROM Task LIMIT 20];

        return mytask;
    }

}
Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra