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

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