I am in Winter '16 and trying to unlock and lock a record in APEX and I am getting the following exception

FATAL_ERROR System.UnexpectedException: Apex approval lock/unlock api preference not enabled.

Does anyone know what is the problem?

1 Answer 1


You need to go to

Setup->Create-> Workflows and Approvals -> Process Automation Settings

and set checkbox Enable record locking and unlocking in Apex as true

enter image description here More information here.

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.