function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Change Owner Question

I'm trying to get the owner field and ChangeOwner link onto a VF page for a custom object.  Owner field is just fine.  But I can't get ChangeOwner to work.


I'm trying this code:

<apex:outputLink value="{!URLFOR($Action.CustomObject__c.ChangeOwner,}" rendered="true" >[Change]</apex:outputLink>


When the page renders, the link shows up fine.  But when I try clicking on the link it sends me to the login page saying in red that I have to be logged in to perform that function.  I am, obviously, already logged in when I click the link.



Best Answer chosen by Admin (Salesforce Developers) 

An FYI post...


I got an answer from support on this.  Apparently !URLFOR($Action is not working for custom objects.  


Workaround is:


<apex:outputLink value="/{!}/a?retURL=/apex/NameOfCustomVFPage?id={!}">[Change]</apex:outputLink>