4

I have some Apex batch code that is run from an InstallHandler to update fields on a custom object when an upgrade is done. As the resulting Apex Job aborted (with no detail of why) in a recent install, I am now wondering whether records locked by an approval process could have caused the problem.

Reading http://na3.salesforce.com/help/doc/en/approvals_considerations.htm, records locked by an approval process can be updated by an administrator.

Reading Any docs on the permissions of the special InstallHandler package user?, it seems that the InstallHandler runs under a rather undocumented special profile and user.

My question is can anyone point me to documentation that clarifies how this special profile handles locked records? Or has anyone clear evidence of such an update working or failing from an InstallHandler?

1

From salesforce support:

I managed to test this scenario. I created a managed package with the install handler that will update a field of an Sobject record. I saw that the install handler can update the record which is locked by the approval process. Hence the install handler has the permissions of the system administrator and can update the record which is locked by approval process. The batch apex would have aborted for some other reason and not because the record was locked.

So in short, the answer is "yes".

1
  • 1
    Put another way, any user with the permission to install the app should also have permission to update the records that are locked, because they should have the Modify All Data and Install Package permissions.
    – sfdcfox
    Oct 14 '13 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.