You need to sign in to do that
Don't have an account?
SIVASASNKAR
VISUAL FORCE HOW TO GET Owner FIELD ON VISUAL FORCE PAGE
>>
>>
I WANT TO DISPLAY MY OWNER FIELD ON VISUAL FORCE FIELD.
Example:
I HAVE UNIVERSITIES__C CUSTOME OBJECT OWNER IS SIVASANKAR ADMIN
I'm unable to display my woner field on the visual force page
<apex:inputField value=" {!Universities__c.owner} "/>
OR
<apex:outputField value="{!Universities__C.Owner}"/>
Owner is the related record, you need to bind the field itself, which is the id. E.g.
Thanks Bob one probelm was solve but it conn't display the owner name when I try to display the owner name like as follows
<apex:outputField value="{!Universities__c.ownerid}"/>
---
I get Output like this
owner
insted of this
Owner Sivasankar Admin
it cann't display the owner name like Owner Sivasankar Admin
Hi Siva,
try this, i think it should work:
<apex:outputField value="{!Universities__c.owner.name}"/>
regards
Sam
Hi Jungleee,
first thanks for replayed me
Sorry to say it is not working
How are you retrieving the record? Are you using a standard controller or a custom controller?
Thanks for replaying
i'm Using standard Controller
Hi
If you're using a standardcontroller then the owner.name will work.
I just tried this:
<apex:page standardController = "Case">
<apex:outputField value="{!Case.Owner.Name}"/></br>
<b>without the outputField attribute : </b>{!Case.Owner.Name}
</apex:page>
I get the results as expected i.e.,
Owner Name
Owner Name
I am not sure why its not working for you.
Thanks
Sam
Thanks Sir,
Go to ACCOUNT object --->NEW
Hear You can see the field Name like Account Owner Sivasankar Admin
I'm using Standard Controller
When i try to get ownerid like this
<apex:outputfield value="{!Account.Ownerid}"/>
I got the output like this Account Owner blank space
<apex:outputfield value="{!Account.Owner.name}"/>
I got the output like this Name blank space
But
i want the output as Account Owner Sivasankar Admin
please suggest me...
<apex:page standardcontroller="objName__c">
<apex:outputField value="{!objName__c.Ownerid}"/>
</apex:page>
I guess there might be something missing kindly check it again.
OR
delete the page and try with a new page
How are you accessing the page? When using a standard controller you have to pass the id of the account you are accessing as a URL parameter, something like:
https://kab-tutorial.na6.visual.force.com/apex/AccountOwner?id=0018000000iAiZS
if you leave the id blank you will get a new, uninserted record with no owner and thus the field will be null.
<apex:column >
<apex:facet name="header">
<apex:commandLink target="_self" action="{!ViewData}" value="Case Owner{!IF(sortExpression=='OwnerId',IF(sortDirection='ASC','▼','▲'),'')}" >
<apex:param value="OwnerId" name="column" assignTo="{!sortExpression}" ></apex:param>
<apex:param value="cases" assignTo="{!sortObject}" ></apex:param>
</apex:commandLink>
</apex:facet>
<apex:outputLink value="{!URLFOR($Action.Case.View, ca.Id)}" target="_blank">
<apex:outputText value="{!ca.Owner.Name}" /> //Made a change here to use Name. Needs more changes. This alone causes Loading timer to spin.
</apex:outputLink>
</apex:column>
<apex:column value="{!ca.OwnerId}">
<apex:facet name="header">
<apex:commandLink target="_self" action="{!ViewData}" value="Case Owner {!IF(sortExpression=='OwnerId',IF(sortDirection='ASC','▼','▲'),'')}" >
<apex:param value="{!ca.Owner.Name}" name="column" assignTo="{!sortExpression}" ></apex:param>
<apex:param value="cases" assignTo="{!sortObject}" ></apex:param>
</apex:commandLink>
</apex:facet>
</apex:column>
It will work when you pass id of account's record in URL as https://c.ap6.visual.force.com/apex/pageName?id=<record id>