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

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

  • Its giving save error. Extra ',' .. Do in need to change some thing in controller code – TestNS Sep 26 '13 at 8:38
  • 1
    @TestNS just use . instead of ,: application.CreatedBy.name – Sergej Utko Sep 26 '13 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 '13 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.