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
Yogesh_Rankawat.ax397Yogesh_Rankawat.ax397 

Change case owner problem in before insert trigger on case

Hi All

 

I have written a trigger as below

trigger testChangeOwnerTrigger on Case (before insert) { for(Case newCase : Trigger.New){ newCase.OwnerId ='005R0000000IufqIAC'; } }

 

Here the 'created use'r and 'new owner user' has the same profile.

 

This trigger is working correctly when I create case with System Administrator profile user, but when create case with other profile user then it throw an error "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. Click here to return to the previous page "

 

I checked the profile & it has all data modification permissions.

 

Any idea?

 

Thanks

 


 

SummerRainSummerRain

Hello,

 

Did you solve the problem? I met the same error. 

Please post how you solve it. 

 

Thanks.

teddyteddy
I am having exactly the same issue. The User to whom i am trying the pass ownership as well as the user creating the case have "Manage Cases", "Transfer Cases" and visiblity to most case fields. In addition, the org wide security settings for cases is Public/Read/Write/Transfer. It is really weird that the non admin user can't transfer the ownership suring creation.
skausskaus

I am facing kind of a similar problem.

 

I have a profile : AFA Help Desk with following features :

1. Manage Cases - check

2. Transfer cases - check

3. Sharing rule based on case record type that grants Read/Write access to the concerned role.

 

Use Case : AFA Help Desk profile user updates a case with a particular status , based on status value , case owner is changed to a different profile.

Error :

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.
 
Following points to be noted :
Error comes only when  trying to update via trigger. This user can update owner manually.
Even if trigger code is changed so that case.owner is set to the current owner himself. , it gives the same error.
The class refrenced in trigger is not using with sharing keyword.
Case has private sharing model but has been shared with this users' role via sharing settings.
 
This  issue has left me clueless. Any replies appreciated.
 
Samy.SaiedSamy.Saied

I have tried to enable the option "Transfer Case" on the profile of that user and it worked for me. Maybe you can try the same.

Rebecca VandersliceRebecca Vanderslice
Did any of you find a resolution to this problem?  I am getting the same error now with a trigger to change the owner is active.  Thanks!
Michael GoldschlagerMichael Goldschlager
Has anyone found a solution to this?