Posts

Salesforce Screen Flow - Roll Back Behavior

Image
 Similar to Apex Roll Back, as part of Winter 22, Salesforce has introduced Flow Roll Back feature also. Let us see the transaction behavior when using roll Back along with Screen Flow. 1. Feature Details As of now Roll Back feature is available only for Screen Flows.  All pending operations in the current transaction will be rolled back on adding Roll Back element to a fault connector. This is useful when we have a series of DML operations happening in a single transaction and ScreenFlow will try to combine all those into a single transaction 2. Use Case - Single Input Screen - Multiple DML  I would like to develop a screen where you can create both Account and Contact together on a single screen. The flow looks like below: The input screen looks like below: And once you enter details in all fields and click on next, Below operations will be happening: Below is the Transaction Behavior 3. Add failure to Contact Save Now let us add a validation rule on Contact to make the email field m

Salesforce Change Data Capture - Asynchronous Triggers and Subscription using MuleSoft & CometD

Image
 In this post, let us see what is Change Data Capture, when to use them and the different subscription approaches. 1. What is Change Data Capture Change Data Capture is similar to Platform Events. This can be used to keep your external system in sync with Salesforce data. It is supported for all custom Objects and some standard Objects.  The supported standard object list can be found here . Once enabled for a particular object, whenever that object record is created, updated, deleted or undeleted, an event will be fired to the event bus. This fired event will be available for 72 hours on the bus and an external application can subscribe to this. How it is different from Platform events? 1. In platform events, we can define our own fields and structure whereas CDC is applied on existing Objects 2. You can publish platform events from Flows, Apex, and process but CDC is fired by default on record changes How to Enable CDC? Go to setup->Integrations->Change Data Capture Here you ca

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 Account ABC sho