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?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
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
More information here.