• Nancy Chhatwal
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
String searchQuery = 'FIND \'' + searchKey + '\' IN NAME FIELDS RETURNING Account(Name,Owner.Name),Contact(Name,Owner.Name),Lead(Name,Owner.Name),Opportunity(Name,Owner.Name)';
 List<List<sObject>> searchSobj = search.query(searchQuery);
I get a result like,for eg I search 'test' in search bar of a vf page, which should actually return me a record with name test in Account,but it also returns the related list records on the account test. Why is it happening?