Assume, I've got a standard picklist field
Account with values
Cold. Using enabled
Translation Workbench I've translated these values into German.
When the language of a user is set to
English, and the user performs a SOQL query
SELECT Id, Rating FROM Account WHERE Rating LIKE 'Cold'
N records. But if we change the language of the user to
German, the same SOQL query returns
0 records. However, when it changes to
SELECT Id, Rating FROM Account WHERE Rating LIKE 'Kalt'
N records as well as for the very first scenario. At the same time, the returned values of the
Rating field remain untranslated ('Cold'). This means that the
LIKE operator implicitly translates the values of picklists before comparison. I've tested
= SOQL Comparison Operators and they don't behave like
LIKE, they perform a comparison based on picklist value
API Name not
Label. There is no such information about it in Salesforce Docs.
So finally my question is:
Why does the
LIKESOQL operator implicitly translate picklist values before comparison and how to perform a comparison based on picklist value API Names using the