Skip to main content
Hi everyone,

I have created a search bar(ProjectSearch) in VF page to show the records in the page based on the result for a specific field(Project_ID__C), but right now it showes the results if I put the exact value of that field(Project_ID__C), while I need it to show the results if I just enter a part of the value of that field(Project_ID__C). please advise:

 stdSetCont =  new ApexPages.StandardSetController(Database.getQueryLocator([Select id,,Project_ID__c from Charts__c where Project_ID__c =: ProjectSearch and HRS_Site_ID__c =: ApexPages.CurrentPage().getParameters().get('hrsId') Limit 10000]));

        
2 Antworten
  1. 21. Apr. 2015, 22:03
    Try this:

    ProjectSearch = '%' + ProjectSearch + '%';

     stdSetCont =  new ApexPages.StandardSetController(Database.getQueryLocator([Select id,,Project_ID__c from Charts__c where Project_ID__c like :ProjectSearch and HRS_Site_ID__c =: ApexPages.CurrentPage().getParameters().get('hrsId') Limit 10000]));

    ==========

    ps: If your question/problem is resolved, please mark your post as 'Solved' so that community can benefit from solutions. 
0/9000