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
mac_046mac_046 

INSUFFICIENT ACCESS ON CROSS REFERENCE OBJECT

Hi

 

I have a With sharing class and a Time Triggered workflow on Opportunity. The workflow will close the Opportunity when criteria is met. When the workflow fires the Class will be invoked by the Trigger and I am trying to close all the Open Tasks related to the Opportunity. But the functionality is not workig properly, I am getting the INSUFFICIENT ACCESS TO CROSS REFERENCE OBJECT error. I think when the workflow is fired I am assuming the WITH SHARING class is consdering the USER Permissions that has submitted the Opportunity to the workflow. Any ideas or help Pls. 

mac_046mac_046

I did some analysis and figured out that it is not possible. However, alternative solution is to remove the code from With Sharing class and wirte it in either Without Sharing class or trigger.