You need to sign in to do that
Don't have an account?

Change record owner in VisualForce page
I'm using an outputfield to display the owner of my custom Project object in a VisualForce page - but I can't figure out how to add the [Change] link beside the owner name to enable the user to change the record owner.
Code:
<apex:outputfield value="{!Project__c.OwnerID}" />
Can anyone help? Thanks!
if u want to change the record owner name u have to use
<apex:inputfield value="{!Project__c.OwnerID}"/>
----------------------------------------------------
<apex:outputfield> displays only read only properties
thanks & regards
Amar Joshi
i was also stucked with this problem
i have find out a way like bellow
i have create on custom field "record owner" in my object in which i change the record owner the data type of that field is lookup
now i ma use <apex:inputfield value="{!gettermethodname.record_owner__C"}>
so i get same look and feel of original now to get the
in getter method u get the value of the owner and the assign it to record_owner_c now from look up button u can change the record owner
now at save time assign the record_owner__c to owner.name
with this way u can achieve the same look and feel of standard page and also change the record owner
Thanks & Regards
Amar joshi
Message Edited by Lets Play Catch on 12-14-2008 04:17 PM
Message Edited by Lets Play Catch on 12-14-2008 04:18 PM
but what happen in this stage
we can change the owner.name but when we click the save button of that page it navigate me to the page like
http://na2.salesforce.com/{!lead.id}
not my costume lead convert page or the standard lead convert page in lead object when we press convert button
what i want here i can change the owner.name and also want to navigate back my lead convert page
if this can be done without creating the costume lookup field record owner to the user object then please let me know
Thanks & regards
Amar Joshi
salesforce CRM consultant
try this
<a href="/{!id}/a?retURL=/{!id}">[Change]</a>
Sandra, this worked perfectly. Thank you!
I don't know if this is helpful, but certain object types have their own custom change functionality. In this instance using Case/Contact, the Case Owner.
This is in full context of a custom page, but you probably are most interested in the "apex:outputText".tag sets