• Eric Perowne
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I have a record of the Incident object that is automatically submitted for approval upon creation. The approval process locks the record, but I would like to unlock it right away.

Now in my trigger I have:

trigger IncidentBeforeTrg on Incident__c (before insert, before update) {
for(Incident__c newInc:trigger.New){
if(Trigger.isUpdate && Approval.isLocked(newInc.Id)){
Approval.unlock(newInc.Id);
}
}
}

But this does not seem to be doing anything. What am I missing?