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
lalitha kellalalitha kella 

i want information of only one employee in office using visualforce

DeepthiDeepthi (Salesforce Developers) 
Hi Lalitha,

If you are saving the data of all your employees in an object then you can fetch the single employee detail as per your requirement.
Please check the below sample code:
  
<apex:page controller="Sample1">
<apex:form >
    Employee name &nbsp;&nbsp; <apex:inputField value="{!emp.name}"/> <br/>
   <apex:commandButton value="Fetch employee" action="{!Fetch}"/>
   <apex:pageBlock >
   <apex:pageBlockTable var="e" value="{!emp1}">
       <apex:column value="{!e.name}"/>
       <apex:column value="{!e.Age__c}"/>
   </apex:pageBlockTable>
   </apex:pageBlock>
</apex:form>
</apex:page>
 
public with sharing class Sample1 {
    public Employee__c emp {get;set;}
    public Employee__c emp1{get;set;}
    public Sample1(){
        emp = new Employee__c();
        emp1 = new Employee__c();
    }
    public PageReference Fetch() {
        emp1= [select Name, age__c from Employee__c where Name=: emp.name];
        return null;
    }

}

The resulting page is like:
User-added image
When you enter the name of a particular employee in the input field and click on Fetch Employee button then details of the employee will be displayed as below:

User-added image

Hope this helps you!
Mark this solution as best answer if it meets your requirement. Let me know if you need any further help!
Best Regards,
Deepthi
lalitha kellalalitha kella
Thanks for helping me