The employee is a custom object in my database using which i want to display the employee details on the visual force page. I want the details from employee object of that particular employee/user which has logged in.
public class Employee {
public Employee() {
empList = new List<Employees__c>();
empList = [select id,First_Name__c,Last_Name__c,EmpID__c,Email__c,Department__c,contact__c,cityy__c,Address__c from Employees__c];
}
Public List<Employees__c> empList{get;set;}
Public string searchString{get;set;}
Public void searchEmp(){
searchString += '%';
empList = new List<Employees__c>();
empList = [select First_Name__c,Last_Name__c,EmpID__c,Email__c,contact__c,cityy__c,Department__c,Address__c from Employees__c where First_Name__c like : searchString limit 10];
}
}
Hope this helps.
Kindly mark this as solved if the reply was helpful.
As per my requirement this code is not working. My requirement is that if my any Employee do login at that time it should show details of that particular Employee which is logged in and details should come from Employee custom object. It should not show any other Employees details.
May I request you please be more specific on your requirement what you need to display on the visual force page?
Are you trying to display the logged in user details on the visual force page?
Or, the employee is a custom object in your database using which you want to display the employee details on the visual force page?
Please confirm so that we can understand better and can help you accordingly.
Thanks,
Nagendra
Thanks for reply..
The employee is a custom object in my database using which i want to display the employee details on the visual force page.
I want the details from employee object of that particular employee/user which has logged in.
Please find the code below which is working fine for me.
Visual Force Page: Apex Controller: Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
Thanks for reply
As per my requirement this code is not working. My requirement is that if my any Employee do login at that time it should show details of that particular Employee which is logged in and details should come from Employee custom object. It should not show any other Employees details.