You need to sign in to do that
Don't have an account?

SOSL Bind Variable Stopped working
Code that has stopped working:
---
soslQuery = 'FIND :searchString IN NAME FIELDS RETURNING '
+ typeObject +'(Id, '+nameField+ ' where ' +prefix+filterType+ ' = \'' +filterValue+ '\' ORDER BY '+nameField+') LIMIT 20';
List<List<SObject>> results = Search.query(soslQuery);
---
If we replace the query like the below, it is returning results.
soslQuery = 'FIND \'*' + searchString + '*\' IN NAME FIELDS RETURNING '
+ typeObject +'(Id, '+nameField+ ' where ' +prefix+filterType+ ' = \'' +filterValue+ '\' ORDER BY '+nameField+') LIMIT 20';
SOSL is not honoring the values in the bind variable from today.
---
soslQuery = 'FIND :searchString IN NAME FIELDS RETURNING '
+ typeObject +'(Id, '+nameField+ ' where ' +prefix+filterType+ ' = \'' +filterValue+ '\' ORDER BY '+nameField+') LIMIT 20';
List<List<SObject>> results = Search.query(soslQuery);
---
If we replace the query like the below, it is returning results.
soslQuery = 'FIND \'*' + searchString + '*\' IN NAME FIELDS RETURNING '
+ typeObject +'(Id, '+nameField+ ' where ' +prefix+filterType+ ' = \'' +filterValue+ '\' ORDER BY '+nameField+') LIMIT 20';
SOSL is not honoring the values in the bind variable from today.
See https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005ic5QAA
No other solution yet as the concatenation workaround.
Regards,
Thomas