Skip to content

Instantly share code, notes, and snippets.

@dhaniksahni
Last active February 9, 2020 18:58
Show Gist options
  • Save dhaniksahni/523db42bdc45b018e9409bdb42e47d64 to your computer and use it in GitHub Desktop.
Save dhaniksahni/523db42bdc45b018e9409bdb42e47d64 to your computer and use it in GitHub Desktop.
public class UpdateCaseQueuable implements Queueable {
public List<Case> caseList ;
public UpdateCaseQueuable(List<Case> cases){
this.caseList = cases ;
}
public void execute(QueueableContext context) {
for(Case a :caseList){
a.Description ='Updated from UpdateCaseQueuable';
a.Status='Closed';
}
update caseList;
//Finalizer class
SendEmailFinalizer emailFinalizer = new SendEmailFinalizer();
System.attachFinalizer(emailFinalizer);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment