• tarun sharma 92
  • NEWBIE
  • -1 Points
  • Member since 2020

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

Hi all,

 

I have a strange issue with SOSL where when I query SFDC standard objects like contacts I get back my results as expected, e.g.: 

 

//An anonymous block

List<List<SObject>> searchList = [FIND '*vic*' IN ALL FIELDS RETURNING Contact(id)];

contact[] contacts = ((List<contact>)searchlist[0]);

System.debug('Contacts: '+Contacts);

 

//Results

Anonymous execution was successful.

 

20090924185445.738:AnonymousBlock.itil: line 1, column 34: SOSL query with resulting 2 rows finished in 17 ms

20090924185445.738:AnonymousBlock.itil: line 3, column 1: Contacts: (Contact:{Id=0038000000iEdvtAAC}, Contact:{Id=0038000000dx3GGAAY})

But when I try the same thing on a custom object I can see it finding rows, but it doesn't actually return them:

 

//Anonymous block

List<List<SObject>> searchList = [FIND '*vic*' IN ALL FIELDS RETURNING Incident__c(id)];

Incident__c[] incidents = ((List<Incident__c>)searchlist[0]);

System.debug('Incidents: '+incidents);

 

//results

Anonymous execution was successful.

 

20090924185616.733:AnonymousBlock.itil: line 1, column 34: SOSL query with resulting 11 rows finished in 23 ms20090924185616.733:AnonymousBlock.itil: line 3, column 1: Incidents: ()

 The SOSL query resulted in 11 rows, but the array is empty. It seems to be finding the records, but not return any data on them.

 

I can get the records in a simple case like this via a SOQL query, so I know they're in the database and readable from the anonymous block.

 

Help! 

 

 

 

 

Message Edited by cpeterson on 09-24-2009 12:00 PM