I created a trigger that on a record creation (Custom sObject), subscribes all the createdBy role members to the record.
This code seems to work just fine when executed by a sys admin, but it throws the following error for a user with Chatter Only profile.
Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
What I'm missing here ??
Attribution to: melmoussaoui
Possible Suggestion/Solution #1
It was me! I forgot to remove the "With sharing" keyword from the class definition. My bad!
Attribution to: melmoussaoui
Possible Suggestion/Solution #2
Chatter Only profile might not be having sufficient permissions like create,read,update and delete permissions. once check those permissions.
Attribution to: SALESFORCE STUDENT
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/32627