1

Need some pointers from you, I have a custom "status__c" field in users. In a VF page i need to display User name and Status fields, That has been done. Now the thing is that, when an outputlink for the username is given "abc". That link should navigate to UserDetail Edit page of "abc".

I tried this,

<apex:column headerValue="User First Name">
            <apex:outputlink value="/{!u.userId}" target="_blank">
            {!u.theUser.FirstName}
            </apex:outputlink> 
            </apex:column>

But this takes me to the Chatter page of the User and not the user detail page. When i tried this

{!URLFOR($Action.User.Edit,u.userId)}

-> this throws me an error.

1 Answer 1

1

The $Action.Edit does not support the User object.

If you add /e to the end of your URL it will take you to the Edit page:

<apex:outputlink value="/{!u.userId}/e" target="_blank">
            {!u.theUser.FirstName}
            </apex:outputlink> 

You should also consider adding the retURL so that when the end user saves or cancels after editing the user record they will be brought back to your VisualForce page. See How to get previous page's URL in Salesforce

2
  • I'm working this with ServiceCloud console. I have used a list view button as "View User Status". This current solution u provided takes me to edit page by default without having to give target="_blank". I would like to retURL to case view page. Can you tell how its achievable, I tried this , {"/{!u.userId}", ['retURL'='/500/o'])} /500/o is the case view page, but its not taking me after edit.
    – AjaySFDC
    Commented Sep 26, 2014 at 12:56
  • Try {"/{!u.userId}/e?retURL=%2F500%2Fo"}. %2F is the URL encoded version of /
    – BarCotter
    Commented Sep 26, 2014 at 13:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .