Posts

Showing posts from July, 2020

Mapping of Flows in Salesforce

Image
What is Salesforce Flow? Flow is a powerful business automation tool that can manipulate data in Salesforce in a variety of ways. Such application can be created right from the org’s setup with just drag-drop/point-click. The ease of creating flows makes it the number one go-to tool when it comes to complex business requirements. It is not only easy to create, but also it does not require any coding. Beware! That does not mean you don’t need to know the Salesforce platform’s object relationships and overall how Salesforce runs. You have got to have (at least) mid-level understanding of SFDC and its features in order properly use flows. First, we are going to show how a flow is created and how it  flows  (it is a flow after all, isn’t it?). Flows can be created from Setup,  enter Flows in the Quick Find box, then select  Flows , and then click  New Flow .   When should I use Flows vs Process Builder? Flows and Process Builders are similar. Here are some of the key differences and simila

Avoid Recursive Trigger Calls In Salesforce

Image
Recursion occurs when same code is executed again and again. It can lead to infinite loop and which can result to governor limit sometime. Sometime it can also result in unexpected output or the error “maximum trigger depth exceeded”. So, we should write code in such a way that it does not result to recursion. For example, I’ve a trigger on Account object, which will be execute on before Update and after Update. In after Update I’ve some custom logic to update Account records. So, when I’m updating the Account records in After Update, it is throwing error “maximum trigger depth exceeded”. So, it is a recursion in apex trigger. To avoid the situation of recursive call, we have to write code in such a way that the trigger will execute one time. To do so, we can create a class with a static Boolean variable with default value true. In the trigger, before executing the code keep a check that the variable is true or not. Here in below trigger, I want to execute both before and after Update