You can get the User's Role directly by using this syntax:
String uRoleId = UserInfo.getUserRoleId();
And you can additionally query the UserRole object to get the Role Name, if needed.
Are you then asking how to see if the Role Name is in a multi-select field value?
The multi-select field should be a semi-colon seperated list of strings. So you could try to split that field value in a String[] using the String class, and check to see if the Role Name value exists.
We are trying to populate user and user role object. I am really not clear with user role object. What is the use of this table on SFDC side? Can we customized this table?
You can get the User's Role directly by using this syntax:
String uRoleId = UserInfo.getUserRoleId();
And you can additionally query the UserRole object to get the Role Name, if needed.
Are you then asking how to see if the Role Name is in a multi-select field value?
The multi-select field should be a semi-colon seperated list of strings. So you could try to split that field value in a String[] using the String class, and check to see if the Role Name value exists.
HI,
We are trying to populate user and user role object. I am really not clear with user role object. What is the use of this table on SFDC side? Can we customized this table?
Thanks,
Sandeep Jain