1
<apex:outputField value="{!application.CreatedById}" 
                  style="font-size:11px;font-weight:bold;color="grey"/>

<apex:outputText value="{!application.CreatedById}" 
                 style="font-size:11px;font-weight:bold;color="grey"/>

This both is giving me different value. Output Field is showing name and outputtext is showing id. I want to use output text to show name. Is it possible... as i have to add styling to it

1 Answer 1

2

Try this

<apex:outputText value="{!application.CreatedBy.name}" 
                 style="font-size:11px;font-weight:bold;color="grey"/>

Uses the relationship to bring back the name

3
  • Its giving save error. Extra ',' .. Do in need to change some thing in controller code
    – TestNS
    Sep 26, 2013 at 8:38
  • 1
    @TestNS just use . instead of ,: application.CreatedBy.name Sep 26, 2013 at 8:42
  • It worked thanks.... Done one more change in controller code ... i was missing CreactedBy.Name in Query.. Added that as well
    – TestNS
    Sep 26, 2013 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .