+ Start a Discussion

Find query

Hi to all,


I have created a visualforce page for SITES using CONTACT Object.

My visualforce page:

::::PAGE EDITOR:::::


<apex:page controller="theController">
   <apex:form >
      <apex:pageBlock mode="edit" id="block">
         <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
               <apex:outputLabel for="searchText">Search Text</apex:outputLabel>
               <apex:panelGroup >
                  <apex:inputText id="searchText" value="{!searchText}"/>
                  <apex:commandButton value="Go!" action="{!doSearch}" status="status"/>
        <apex:pageBlockSection title="Results" id="results">
           <apex:pageBlockTable value="{!results}" var="l" >
               <apex:column headervalue="Last Name" width="250">
                   <a href="/{!l.Id}">{!l.LastName }</a>
               <apex:column headervalue="Account Name" width="250">
                   <a href="/{!l.AccountId}">{!l.Account.Name}</a>





public class theController

   String searchText;
   List<Contact> results;
   public String getSearchText()
      return searchText;
   public void setSearchText(String s)
      searchText = s;
   public List<Contact> getResults()
      return results;
   public PageReference doSearch()
         results = (List<Contact>)[FIND :searchText RETURNING contact(id,LastName, AccountId,contact.Account.Name)][0];
         return null;


I am using Find query....
that find query searches the Contact lastname only.....
My search defined as Contact Account Name..
How to change the Find query????
Pls help me.....