You need to sign in to do that
Don't have an account?
Valentina Ermilova
Can't get User by DML
I got user Id and trying to get user. This user is exist with this Id exactly. But I get 0 rows.
Where the error can be?
if (Schema.sObjectType.User.fields.Email.isAccessible() && Schema.sObjectType.User.fields.FirstName.isAccessible()){ User recipient = [SELECT Email, FirstName FROM User WHERE Id = :recipientId]; }This script is a part of our REST API. So it run with permissions of Site Guest User.
Where the error can be?
All Answers