I am querying for a particular user in my class(without sharing),it is returning null sometimes.User is available and he is the system administrator.
What might be the reason ? Am i missing anything ?
Here is my Query [Select id from user where FirstName = 'Vipul' and lastname = 'Sama' and profile.name = 'System Administrator' limit 1].
Thanks very much.
Attribution to: Keepcalmncode
Possible Suggestion/Solution #1
I think it is because of translation from endlish to chinees. You should take better ID and not a hrdcoded Name.
Here is some info for you: Profile Name changes based on user language
Attribution to: Sergej Utko
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4904