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 ??

2 Answers 2


It was me! I forgot to remove the "With sharing" keyword from the class definition. My bad!


Chatter Only profile might not be having sufficient permissions like create,read,update and delete permissions. once check those permissions.

  • Actually he has the right to do so. I tried with hardcoded Ids in a list of EntitySubscription and they were inserted correctly . Commented Apr 14, 2014 at 11:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .