Posts

Showing posts from July, 2021

LinkedIn

Transaction Finalizers for Asynchronous Apex Jobs

Image
Transaction Finalizers are Generally Available from Summer 21 release. Let us see the features and how to implement Transaction finalizers in this blog post. 1. What is Transaction finalizers? The Transaction Finalizers feature enables you to attach actions, using the  System.Finalizer  interface, to asynchronous Apex jobs that uses the Queueable framework. The logic associated with Finalizer implementation will be executed once the asynchronous execution finishes.  2. Methods available for Finalizer Interface We can get below details of the executed job process in the finalizer Implementation: 3. Features of Transaction Finalizers 4. Implementation Details Use Case We want to execute 2 operations: 1. When ever a new contact is getting created/updated with Country field value, parent Account's Account country field should be appended with new country If Account ABC has 2 contact - Contact X with country India and Contact Y with country France, the Account Country in Accou...