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
harish garimellaharish garimella 

display a user fiels in visualforce pages

i want to display or retrieve a user fiels in visualforce pages 
  fields which are in customize! users!fields
which may be standard fields or custom fields

Thanks in Advance 
Karan Khanna 6Karan Khanna 6

if you intend to display User fields of current logged-in user then use it in this way:

    Hello {!$User.FirstName}!

harish garimellaharish garimella
in customize!user!fields

we can create a fields for view for the user profile some extra fields we can create i need to display those fields in visualforce pages

Karan Khanna 6Karan Khanna 6
then you can create an instance of User in your controller like: 
public class MyClass {

	public User myUser;
	public getmyUser() {
		myUser = new User();
	// your code	

and refer myUser in your page like:
praveen murugesanpraveen murugesan

Contorller code:

public User us{get;set;}

public xxxx()
          us = [select title,email,department,manager.Name,phone from user where id =: userInfo.getUserID()];
        catch(Exception e)



<apex:outputText id="phone"  value="{!us.Phone}" />
<apex:outputText id="email"  value="{!}" />
<apex:outputText id="name"  value="{!}" />
<apex:outputText id="profile"  value="{!us.ProfileId}" />

Hope this answered your question.


Praveen Murugesan
Mahanandeesh BelagantiMahanandeesh Belaganti