Insufficient Privileges when viewing Salesforce EmailMessage Record

Insufficient Privileges when viewing Salesforce EmailMessage Record

When viewing the EmailMessage records, the following Exception is thrown when the EmailMessage Status is 5 i.e draft.

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. For more information, see Insufficient Privileges Errors.

Following SOQL can be used to find the Status of the EmailMessage record.

Sample SOQL:

SELECT RelatedToId, ParentId, Status, CreatedBy.Name
FROM EmailMessage
WHERE Id = '<EmailMessageId>'

When the status of the EmailMessage Status is 5 i.e draft, then only the EmailMessage creator and the users with Modify All Data permission can access it.

Leave a Reply