Skip to main content
Hi, Could anyone tell me whether this is possible?

I'm wanting to check whether an account name already exists within my SF database.

Let's say I have an existing account named "Test Computers", when I submit a search for 'Test' only I DON'T want Test Computers to be included in the results.

"FIND {"Test"} IN Name FIELDS RETURNING account (account.Id)"

Thanks,

Mark
3 件の回答
  1. 2015年2月23日 11:33
    Mark,

    SOSL matches fields based on a word match while SOQL performs an exact match by default (when not using wildcards). For example, searching for 'Digital' in SOSL returns records whose field values are 'Digital' or 'The Digital Company', but SOQL returns only records with field values of 'Digital'.

    However, workaround that you may take is that let SOSL return all the results then iterate over those results and compare the value that you search against particular field. If match found store in separate list. I am not sure how much this works for your scenario but please do let me know if it works.

    Thanks
0/9000