+ Start a Discussion
jeroenjeroen 

Problem with looking up info, std. links child-master (CreatedById, LastUpdateBy, etc)

Hello,
 
I am having difficulties getting this to work. I just want the name of the person that created a record in my custom object Project_info__c. I have tried using a standard and a custom controller, since I am not doing much spectacular stuff I would rather stick to the standardcontroller for now.
 
<apex:outputtext value="{!Project_info__c.CreatedById.Lastname}"/>
 
Error: The class 'java.lang.String' does not have the property 'LastName'.
 
Other methode:
<apex:dataList value="{!Project_info__c.CreatedById}" var="r">
        {!r.FirstName}
</apex:dataList>
 
Same error...:smileysad:
 
Any ideas, Thanks
Jeroen:smileyvery-happy:
deshawdeshaw

CreatedById is the Id and not the object.

Use CreatedBy.LastName

Code:
<apex:outputtext value="{!Project_info__c.CreatedBy.Lastname}"/>

 
The above code will work.

Regards,
Manickkam.
jeroenjeroen
Hi Manickkam,
 
I thought I tried everything, but this works perfectly! :smileyvery-happy:
 
Thanks
Jeroen