function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VijaykumarVijaykumar 

SELECT UserRoleId FROM User where UserRole.Name = 'Ramona Biehn's Team'

Hi All,
Am trying to extract the user id from the user role name but am getting the below error, kindly advise.
MALFORMED_QUERY:
UserRole.Name = 'Ramona Biehn's Team'
^
ERROR at Row:1:Column:71
line 1:71 mismatched character '<EOF>' expecting '''

Query: 
SELECT UserRoleId FROM User where UserRole.Name = 'Ramona Biehn's Team'
Best Answer chosen by Vijaykumar
SubratSubrat (Salesforce Developers) 
Hello Vijay ,

The error message you received indicates that there is a syntax error in your query.

Please try with below 
SELECT UserRoleId FROM User WHERE UserRole.Name = 'Ramona Biehn\'s Team'

If it helps please mark this as Best Answer.
Thank you.

All Answers

SubratSubrat (Salesforce Developers) 
Hello Vijay ,

The error message you received indicates that there is a syntax error in your query.

Please try with below 
SELECT UserRoleId FROM User WHERE UserRole.Name = 'Ramona Biehn\'s Team'

If it helps please mark this as Best Answer.
Thank you.
This was selected as the best answer
VijaykumarVijaykumar
Thanks a lot Subrat! it worked.