SOQL query on userType not working when user language is changed and LIKE is used (only works with '=' operator)
Last updated 2017-04-14 ·Reference W-2441296 ·Reported By 10 users
No Fix
Summary
SOQL query on userType not working when user language is changed and LIKE is used (only works with '=' operator)
Repro
WORKING Scenario
------------------
1. Login as admin user
1.1. Make sure user language is "English"
1.2. Make sure there are some "standard" users (or change the query to match existing user types)
2. Open Developer console
3. Run following query (Using toLabel to show the translated value)
SELECT Id, FirstName, LastName, toLabel(userType) FROM user WHERE userType like 'Standard%'
4. Query will return results (if there are any standard users)
NOT WORKING Scenario
---------------------
1. Login as admin user
1.1. Change user language to "Nederlands"
1.2. Make sure there are some "standard" users (or change the query to match existing user types)
2. Open/Refresh Developer console
3. Run following query (Using toLabel to show the translated value)
SELECT Id, FirstName, LastName, toLabel(userType) FROM user WHERE userType like 'Standard%'
Actual results
--------------
- Query will NOT return any results
Expected results
----------------
- Query should return results
- Changing the query to following will work (LIKE to =)
-- SELECT Id, FirstName, LastName, toLabel(userType) FROM user WHERE userType = 'Standard'
Workaround
Use the translated value in query
SELECT Id, FirstName, LastName, toLabel(userType) FROM user WHERE userType like 'standaard%'
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.