Created
November 1, 2019 21:35
-
-
Save jsmithdev/250172702e8118c91c411364866af544 to your computer and use it in GitHub Desktop.
Apex: tiny example util for lock / unlock files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from https://github.com/mshanemc/processBuilderBlocks | |
public with sharing class Util_Locker { | |
public static void LockRecord(list<string> recordIds) { | |
Approval.lock( dedupe(recordIds) ); | |
} | |
public static void UnLockRecord(list<string> recordIds) { | |
Approval.unlock( dedupe(recordIds) ); | |
} | |
public static list<string> dedupe(list<string> input){ | |
set<string> temp = new set<string>(input); | |
return new list<string>(temp); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment