You need to sign in to do that
Don't have an account?
Erica Cox
Using date in FIND of SOSL
I have the need to search for contacts with a match on last name, first name, birthdate, phone, or a number of custom fields. The code is currently building a string for SOSL call that looks, in part, like this:
The list returned only includes matches on firstname, lastname, and phone -- not on birthdate. Are date fields searchable in SOSL? Perhaps I am misunderstanding the documentation when it lists the follwing as a limitation of SOSL :
--Number, date, or checkbox fields. To search for such information, use the query() call instead.
Since I am using query() I thought I was OK, but maybe not?
String sosl = 'FIND \' TestLast OR TestFirst OR (111) 222-3333 OR 2004-12-07\' IN ALL FIELDS RETURNING Contact ( id, firstname, lastname, phone, birthdate)'; List<List<SObject>> searchList = search.query(sosl);
The list returned only includes matches on firstname, lastname, and phone -- not on birthdate. Are date fields searchable in SOSL? Perhaps I am misunderstanding the documentation when it lists the follwing as a limitation of SOSL :
--Number, date, or checkbox fields. To search for such information, use the query() call instead.
Since I am using query() I thought I was OK, but maybe not?
Hope this helps...