+ Start a Discussion

With sharing causing errors when Owner changes from workflow

Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []


This happens when I use code to create an object, then a workflow changes the owner for a normal user, and then I create another object that uses this Id.


Does anyone have a way to get around this without removing the 'with sharing' from my class?