From 653a7d2b9aa19ad40b8d6261ed9878bcc75a3631 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Fri, 4 Dec 2020 13:23:12 -0800 Subject: [PATCH 1/2] TransactionFinalizers is no longer a valid scratch feature in the 230 release with finalizers having move to open beta and no longer requiring an opt-in. Removing from scratch old def accordingly --- config/project-scratch-def.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/project-scratch-def.json b/config/project-scratch-def.json index 61c8d21..40e4e93 100755 --- a/config/project-scratch-def.json +++ b/config/project-scratch-def.json @@ -1,5 +1,4 @@ { "orgName": "kpoorman company", - "edition": "Developer", - "features": ["TransactionFinalizers"] + "edition": "Developer" } From 47ea18cc36fe40610b709576dfbb891b8804ca62 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Fri, 4 Dec 2020 13:30:10 -0800 Subject: [PATCH 2/2] Updated FinalizerContext methods Were using an older variant of the pilot from before two method names were changed to be more future-proof. --- force-app/main/default/classes/Chain.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/classes/Chain.cls b/force-app/main/default/classes/Chain.cls index 7d6af54..8502033 100755 --- a/force-app/main/default/classes/Chain.cls +++ b/force-app/main/default/classes/Chain.cls @@ -9,7 +9,7 @@ public class Chain implements Finalizer { public void execute(FinalizerContext context){ Id parentQueueableJobId = context.getAsyncApexJobId(); - switch on context.getAsyncApexJobResult() { + switch on context.getResult() { when SUCCESS { if(this.promises.size() > 0){ Promise next = this.promises.remove(0); @@ -20,7 +20,7 @@ public class Chain implements Finalizer { } when UNHANDLED_EXCEPTION { System.Debug('Parent Queueable (Job ID: ' + parentQueueableJobId + '): FAILED!'); - System.Debug('Parent Queueable Exception: ' + context.getAsyncApexJobException().getMessage()); + System.Debug('Parent Queueable Exception: ' + context.getException().getMessage()); } } }