+ Start a Discussion
Edwin HerreraEdwin Herrera 

Search for all records

I created a search method called search_now that is used to search for the matching ID inputted into the search box. The code is below.

 public PageReference search_now(){
    results=(List<Work_Item__c>)[FIND:ID IN ALL FIELDS RETURNING Work_Item__c(Work_Item_ID__c, Name,Accountable_IT_leader__c,Percent_Complete__c,LSEF_Stage_del__c)][0];
    return null;
    }

I want to be able to leave the input field blank and when I search it would populate all the records in that object. What code would I insert to make that possible? 
sushant sussushant sus
please refere this link 

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_sosl.htm