Skip to content

Instantly share code, notes, and snippets.

@rahulmalhotra
Created May 15, 2021 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulmalhotra/5ec0434e1a4ff4c20ce5966cb1f38838 to your computer and use it in GitHub Desktop.
Save rahulmalhotra/5ec0434e1a4ff4c20ce5966cb1f38838 to your computer and use it in GitHub Desktop.
Execute method of batch class used in SFDC Stop UNABLE_TO_LOCK_ROW blog
public void execute(Database.BatchableContext bc, List<SObject> records) {
List<Product_Part__c> productParts = (List<Product_Part__c>) records;
for(Product_Part__c productPart : productParts) {
productPart.Count__c = 100;
}
update productParts;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment