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
Neeraj Sharma 103Neeraj Sharma 103 

Hi My Question is When User opens the record by default current users's should be selected in the Name of the Employee field

Hi  Everyone
I am beginner in salesforce so i am facing a issue in this scenario
So Please Help me out for this Scenario How to Do this?

When User Opens the records by default current user's should be selected in 'Name of the Employee ' Field is on Visualforce Page and One Custom Object and in Custom Object when i clicked a new button for a record then the visualforce page is opened so the field is created in Visualforce Page with name Name of the Employee and this field fetch the all users records so i want when a user login with our credentials and go to the Custom object and create a new record then the Name of the Employee field is auto populated with login Users name in Name of the Employee Field and this situation for all users.
Best Answer chosen by Neeraj Sharma 103
Ketan Parab 7Ketan Parab 7

Use User as your standardController to get all the User fields prepopulated, Or have user lookup which can prePopulate user name with syntax {!UserFieldLookUp__.name}