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
Salesforce GeevanSalesforce Geevan 

i was trying to query the Description(textarea) field of case object, when i click the find button entire record are displayed...help me

Vf page 
<apex:page Controller="TEstConteroller" sidebar="false" standardStylesheets="true" showheader="false" >
<apex:form >
    <apex:pageBlock title="CASE" >
  <apex:pageBlockSection >
  <label>Subject</label>
  <apex:inputtext value="{!Sub}" />
 <label>Description</label>
 <apex:inputtext value="{!Des}" />
<center> <apex:commandButton value="find" action="{!search}"  /></center>
 </apex:pageBlockSection>
 <apex:outputLabel >
   <c:PageBlockTableEnhancerADV targetPbTableIds="tableRecords" paginate="true" defaultPageSize="50" pageSizeOptions="50,100,200"/>
</apex:outputLabel>
 <apex:pageblockTable value="{!CaseList}" var="a" id="tableRecords" styleClass="list" border="1">
               <apex:column headerValue="CaseNumber">
     <apex:outputLink value="/{!a.id}">"{!a.CaseNumber}"</apex:outputLink>
</apex:column>
                  <apex:column headerValue="Priority"> {!a.Priority} </apex:column>     
                <apex:column headerValue="Origin"> {!a.Origin} </apex:column> 
                              <apex:column headerValue="Owner"> {!a.owner.Name} </apex:column> 
                        </apex:pageblockTable>
 </apex:pageBlock>

Controller
public class TEstConteroller
{
    public list<Case> caseList {get;set;}
     public string Des {get;set;}
         public string Sub{get;set;}

    public void search()
    {
        CaseList = new List<Case>();
for(Case act : [select id,CaseNumber , Priority,Origin,Case.owner.Name,Description,Subject,from Case ]) {
    if(act.Description.contains('Des') || act.Subject.contains('Sub')) {
        caseList.add(act);
    }
    
    }
}
}
 
 
Pruthvi KankunthalaPruthvi Kankunthala
You have to display the description in Pageblock table . Add this line
<apex:column headerValue="Description"> {!a.description} </apex:column>

Let me know in case of any more help .
Virendra ChouhanVirendra Chouhan
Hi, 
why dont you use WHERE clause in SOQL, The query will fast as well use this:
for(Case act : [select id,CaseNumber , Priority,Origin,Case.owner.Name,Description,Subject,from Case where Description=: des OR subject =:sub ]) {
    caseList.add(act);
}