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
Cable Guy.ax375Cable Guy.ax375 

Insufficient Privileges

The operation only involves with a trigger and a class. I already grant all the profiles to the class for the security. But I still got the following error. Any thoughts would be greatly appreciated.

 

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.

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

Is your class declared as "with sharing" and if so, does the user causing the trigger to fire have access to all objects affected?

All Answers

bob_buzzardbob_buzzard

Is your class declared as "with sharing" and if so, does the user causing the trigger to fire have access to all objects affected?

This was selected as the best answer
Pradeep_NavatarPradeep_Navatar

Following are the probable causes for the  'Insufficient Privileges' error :

          

1.  You have not given all CRUD permission to objects associated with the profile.

2.  Field level security provided to profile.

3.  If you are using the specific license in which there is no role and you are accessing the standard objects(account, contact) for that only read only permission is given so you can not insert,update to the records.