public class Queueable_class implements Queueable,Finalizer,Database.AllowsCallouts{ // class variable public List<String> errors = new List<String>(); // execute method of Queueable interface public void execute(QueueableContext context){ Finalizer finalizer = new Queueable_custProjectTrigger(); System.attachFinalizer(finalizer); errors.add('Some Error Occured'); } //execute method of Queueable interface public void execute(FinalizerContext ctx) { System.debug(errors) // output empty list i.e. []; // but we wish to have the modified list i.e. ('Some Error Occured') }}
Thanks
3 respostas
Thanks for the response @Magulan Duraipandian
However, this example does not seems to work.
It has compile time error on this line :
f.strError = e.getMessage();
Do we have any other example that is working?