+ Start a Discussion
sfdc18sfdc18 

Content cannot be displayed: line 1:118 no viable alternative at character '\'

Hi,

I am getting below error on visualforce page for find query.
Please suggest the changes which I need to make in order to work with below code.

Error -- Content cannot be displayed: line 1:118 no viable alternative at character '\'


String parentIdWhereClause = parentCaseId != null ?  'AND Id <> \''+ parentCaseId +'\'': '';

string casesubjectSearch = caseSubject.replace(' ', ' OR ');

string sosl = 'FIND :casesubjectSearch IN ALL FIELDS RETURNING Case(id,CaseNumber, Subject where RecordTypeId =:recordtype '+String.escapeSingleQuotes(parentIdWhereClause)+' ORDER BY LastModifiedDate DESC) LIMIT 100';
List<List<case>> searchList = search.query(sosl);
Best Answer chosen by sfdc18
Shweta_AgarwalShweta_Agarwal
Hi,
Just remove String.escapeSingleQuotes from your code.
string sosl = 'FIND :casesubjectSearch IN ALL FIELDS RETURNING Case(id,CaseNumber, Subject where RecordTypeId =:recordtype '+parentIdWhereClause+' ORDER BY LastModifiedDate DESC) LIMIT 100';