You need to sign in to do that
Don't have an account?
Tena
RunAs to update locked Opportunity
I have an object that is linked to an Opportunity. When this object is updated it needs to update the opportunity. However, in some cases the opportunity is in an approval process and this causes the error "; first error: ENTITY_IS_LOCKED, the entity is locked for editing: []". Can I use the RunAs to make the class run under an administrator because even though this opp is locked it needs to be updated. I only see runas used in Test Classes.
Thanks,
Tena
According to what I read about system mode is that it doesn't take the user into consideration when running the code. I find this odd becasue when an opportunity is locked and a user exectues a trigger that I wrote there is an error of "ENTITY_IS_LOCKED". However, if I do the exact same thing as an administrator I don't get the error. Does this mean then that the opportunity being locked has nothing to do with this issue?
Thanks,
Tena