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
Mohmad SohelMohmad Sohel 

Hi all, I need help in to create vf page for searching & getting users records

Hi all. I need Vf page & controller to fetch the records of selected users or specified email.

User-added image
Upon clicking Search, if Data is selected, the app will search all data for the User Name OR Email Address and then present the first 10-20 records in a table underneath the Search button with the following columns:
• Object
• Field
• Field Value
• Record ID
• Record Name

I created a VF page:
<apex:page standardController="User_Locator__c" >
<apex:sectionHeader title="User Locator" subtitle="{!User_Locator__c.name}"/>
<apex:form >
<apex:pageBlock mode="edit">

<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Search" action="{!search}"/> 
</apex:pageBlockButtons>

<apex:pageBlockSection title="Information" columns="2">

<apex:inputField value="{!User_Locator__c.User_Name__c}" required="false"/>

<apex:inputField value="{!User_Locator__c.Email_Address__c}" required="false"/>

</apex:pageBlockSection>


<apex:pageBlockSection title="Search in:" columns="2">
<apex:inputField value="{!User_Locator__c.Data__c}" required="false"/>
<apex:inputField value="{!User_Locator__c.Configuration__c}" required="false"/>
</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>

Caleb SidelCaleb Sidel
It looks like what you'll want is to build a Custom Controller.

Check out http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller.htm article about controllers in general and then this one
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_custom.htm about custom controllers specifically.

Remember Apex code has to be written in a Developer instance or a Sandbox and then deployed into a Production instance.

Hope that puts you on the right track!

Mohmad SohelMohmad Sohel
Hi Caleb,
Thanks for your resopnse. The given links are not suitable for my task.

My task is to create VF page & controller to fetch records from selected users.

First I will select an user from User Name lookup field, and I will click on search button, Upon clicking Search, if Data is selected, the app will search all data for the User Name OR Email Address and then present the first 10-20 records in a table underneath the Search button with the following columns:
• Object
• Field
• Field Value
• Record ID
• Record Name
 
Anoop yadavAnoop yadav
Try the below links.

http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/
http://www.sfdcpoint.com/salesforce/dynamic-soql-query-fetch-fields-object-salesforce/