• wd
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

I am sure that I have an Account record that the name is 'Acme', but the follow statements cannot fetch the record. 

The records.size() is 0. What is wrong?

    public static void testSOSL () {
        List<List<sObject>> results = [FIND 'Acme' IN NAME FIELDS RETURNING Account (id, name), Contact, Lead];
        
        sObject[] records = ((List<sObject>)results[0]);

        System.debug('\n\n\n' + records.size() + '\n\n\n');   
    }

 

Environment: Sandbox full

  • September 24, 2010
  • Like
  • 0

I am sure that I have an Account record that the name is 'Acme', but the follow statements cannot fetch the record. 

The records.size() is 0. What is wrong?

    public static void testSOSL () {
        List<List<sObject>> results = [FIND 'Acme' IN NAME FIELDS RETURNING Account (id, name), Contact, Lead];
        
        sObject[] records = ((List<sObject>)results[0]);

        System.debug('\n\n\n' + records.size() + '\n\n\n');   
    }

 

Environment: Sandbox full

  • September 24, 2010
  • Like
  • 0