I am trying to display related contacts on the record detail page based on the current Contact record id. For the related contacts, my SOSL as follows:
String searchQuery = 'FIND \'' + firstName + ' OR ' + lastName + '*\' IN ALL FIELDS RETURNING Contact(Name,Email,AccountId WHERE Id != \' '+ contId + '\') LIMIT 10'; List<List<sObject>> relCons= search.query(searchQuery);
I am passing firstName, lastName and contId as parameters to the method.
Error I get on the VF page (on the contact record detail page):
Content cannot be displayed: invalid ID field: 0033500000XXXXXXXX