Question:
How to unlock an event record if the Unlock_vod button throws the following error:
"The record is locked. If you need to edit it, contact your Admin."
Answer:
In this case, there are two workarounds to unlock the EM_Event_vod record. The first one is to run an anonymous Apex script by following the below steps:
- Navigate to Setup-->Create-->Workflows & Approvals-->Process Automation Settings
- Tick the Enable record locking and unlocking in Apex checkbox
- Run the below script:
EM_Event_vod__c event = [SELECT Id From EM_Event_vod__c WHERE Id = 'eventID'];
Approval.unlock (event,false);
The second workaround is to force the Salesforce Unlock Record button for users with Modify All permission by forcing the page to use the standard Salesforce page.
Related Documentation:
Online CRM Help: Defining Event Flows