+ Start a Discussion
Dev_AryaDev_Arya 

How to remove read/write access on a record for a particular profile?

Is it possible to remove complete access read-write access on a record based on a checkbox update for a particular profile? The concerned sobject is Email Message on which Record Types are not supported, hence looking for alternative solutions. Thanks.
AnudeepAnudeep (Salesforce Developers) 
Unsure if it possible by configuration. However, if you want to try using apex you have to query for the users with a particular profile and set the access level

// Set the access level.
jobShr.AccessLevel = 'Read';

// Set the ID of user or group being granted access.
jobShr.UserOrGroupId = userOrGroupId;

For examples see the documentation

Anudeep