<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Martin Kona on Medium]]></title>
        <description><![CDATA[Stories by Martin Kona on Medium]]></description>
        <link>https://medium.com/@169martink?source=rss-6177d2c807aa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nPxBxR7tl3KiR37DdiNemg.png</url>
            <title>Stories by Martin Kona on Medium</title>
            <link>https://medium.com/@169martink?source=rss-6177d2c807aa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:15:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@169martink/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One Salesforce Flow per Object]]></title>
            <link>https://medium.com/@169martink/how-to-solve-salesforce-flow-error-number-of-iterations-exceeded-95c05fee3dc1?source=rss-6177d2c807aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/95c05fee3dc1</guid>
            <category><![CDATA[solution-design]]></category>
            <category><![CDATA[flow]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Martin Kona]]></dc:creator>
            <pubDate>Wed, 07 Dec 2022 10:05:28 GMT</pubDate>
            <atom:updated>2022-12-12T08:33:19.623Z</atom:updated>
            <content:encoded><![CDATA[<p>The end of 2022 is approaching and so is the deprecation of Workflow Rules and Process Builders. Thankfully, Salesforce has provided a migration tool, which can convert your existing automation to Flows; however, there are some considerations to be aware of. For example, who wants to manage 500 new flows in the system? Or you may think yourself, “why can’t I convert a Workflow rule which uses Record Type reference?” or “do we even need this automation?” and potentially “why is this Process Builder so complicated?”</p><p>Let’s take a look at a different approach, which will make developers happier, and hopefully won’t make admins cry.</p><h3>Developer’s dream of One Flow per Object to rule them all</h3><p>Let me stop you right here. You will need a minimum 3.</p><ul><li><strong>Before save =</strong> Order Before Save</li><li><strong>After save = </strong>Order After Save</li><li><strong>Before Delete = </strong>Order Before Delete</li></ul><p>And that’s not all, you might consider having a flow per department/team, if your organisation is complex and has multiple scrum teams and they can potentially step on each other’s toes…</p><ul><li><strong>Sales team =</strong> Order Before Save_Sales</li><li><strong>Customer service team =</strong> Order Before Save_CustomerService</li></ul><p>… or if your object contains a LDV (Large Data Volume), then I would recommend also having one flow per record type, due to performance considerations:</p><ul><li><strong>Customer = </strong>Account After Save_CustomerRT</li><li><strong>Partner = </strong>Account After Save_PartnerRT</li></ul><p>As you can see, there are many different scenarios and reasons to create new flow. As a result, it is important to set up some naming conventions for flows, variables or elements to ensure there is consistency and readability within your flow architecture. In addition, there should be clear guidelines and rules for when to create a new flow so yes, with these considerations you will need to setup a governance process, ideally including code reviews.</p><p>Let’s have a look, how the “primary” object flow could look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YX_KqYR1X_R-K5ZlxoRN6g.png" /></figure><p>It’s beautiful, so clean. It looks like a painted Apex Trigger, but…wait a minute! It’s throwing a a strange error , when more data is added to the system…</p><h3>2000 Executed Elements at a Run Time Limitation</h3><p>Unfortunately, yes, this exists. <strong>SAFE HARBOR</strong>: <em>this limit is no longer in Spring 23.</em></p><p>Besides CPU time or a SOQL/DML limit, Salesforce has limits on the number of elements executed per run time. This even applies to <em>For Loops</em>. For example, if you have 1000 records being looped and have two actions within the loop, you will consume the limit (1000 * 2) right away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*H5ApQlJcmNHVEq1UNraGZg.jpeg" /></figure><p>Imagine having such a limitation in apex code? Nevertheless, even for this problem there is a solution. One way to counteract one of the many examples of where this limit might be reached is to replace the looped variable assignment with an Apex Action, which will <strong>always be</strong> <strong>counted as one element. </strong>Below you will see how we can put this method into action.</p><h4>Assignment Apex Flow Action</h4><p>First create Apex Action, which takes 3 input arguments:</p><ul><li><strong>inputCollection</strong> = The collection you would like to modify</li><li><strong>fieldApiName</strong> = Object’s Field Api Name to set</li><li><strong>value = </strong>The value you would like to set the fieldApiName field to</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d429ba070e17cf72d72499498c87d561/href">https://medium.com/media/d429ba070e17cf72d72499498c87d561/href</a></iframe><p>Then we can configure our new Apex Action as a flow element:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92IOP-kd4YE7-EYyryxh1g.png" /></figure><p>Tadaaa, the error is gone. You can create similar Flow elements to optimize filtering, data queries with SOQL/SOSL, data transformation, and so on.</p><h4>Filtering Apex Flow Action</h4><p>Another example, where the limit is very easily consumed is collection filtering. This problem can be also solved using Apex Action.</p><p>Input parameters should define what should be filtered.</p><ul><li><strong>inputCollection</strong> = The collection you would like to filter</li><li><strong>fieldApiName</strong> = Object’s Field Api Name to filter</li><li><strong>value = </strong>The value you would like to use as a filter</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/630c17760045a09ee7d8feee5516a0b3/href">https://medium.com/media/630c17760045a09ee7d8feee5516a0b3/href</a></iframe><h4>Data query Apex Flow Action</h4><p>‘Get Records’ element can be sometimes also very limiting or you might need SOSL technology. Before completely switching to Apex Trigger, how about creating a Apex Flow Action?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb7a0e0fa90032c0c42dcff43996e98e/href">https://medium.com/media/bb7a0e0fa90032c0c42dcff43996e98e/href</a></iframe><h4>Summary</h4><p>There is no hard and fast answer that determines whether you should go for multiple small Flows, or apply the “one Flow per object” pattern. Even Salesforce is not clear about this, especially with the migration tool they provide, since it applies a 1:1 conversion…but who knows, maybe it’s just a technical limitation in their script. My advice is to make a decision based on your capabilities, but don’t forget that sooner or later, Flow optimization might be necessary and forward-thinking companies will start addressing this as soon as possible.</p><p>The investment to migrate into these Flow frameworks should be seen as an opportunity for your organisation to take a step back, and get a bird’s eye view of your company’s processes. As a result, not only will it be more efficient under the hood by refactoring your automations, it provides a great opportunity to clean up technical debt and reassess whether those automations are still needed in the first place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95c05fee3dc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reverse Salesforce Architecture]]></title>
            <link>https://medium.com/@169martink/reverse-salesforce-architecture-3f137c30440?source=rss-6177d2c807aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f137c30440</guid>
            <category><![CDATA[consulting]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[enterprise-architecture]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[togaf]]></category>
            <dc:creator><![CDATA[Martin Kona]]></dc:creator>
            <pubDate>Sun, 07 Apr 2019 17:21:31 GMT</pubDate>
            <atom:updated>2019-04-07T17:46:31.529Z</atom:updated>
            <content:encoded><![CDATA[<p>Last week I have passed both TOGAF Foundation and Certified exams and I felt untouchable. There are 8 phases to control architecture lifecycle? Embedded iterations? Stakeholders management and gap analysis? Reusable building blocks? I fell in love from the beginning with the approach and process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*juEfPnp8EIC3_Ag-EeDRZg.png" /></figure><p>It all made sense. First you design <strong>Business Architecture</strong>, you follow with <strong>Information System/Data architecture, </strong>then you finish with <strong>Technology Architecture, </strong>where you finally decide on platforms and products<strong>. </strong>Everything fits together.</p><h3>But then the reality kicks in</h3><p>You work as an architect/consultant, which is assigned to a project. Client has decided that they want Salesforce. Project budget is <strong>X</strong>, requirements are unknown, target business architecture is vague and maybe Salesforce alone might not even be the right fit. Your starting point is basically end of Architecture Development iteration!</p><p>What can you do? This is business and we want to make money. Sales people will sell <em>imaginary unicorns</em> and we love them for that. Everyone is happy and confident except the person who will design the architecture and is responsible for the implementation. Yes, that’s you. Few workarounds later, the project is finished and manager will approach you with warm smile like:</p><blockquote><em>Manager</em>: “<em>See? Everything has ended well…and you were worried!”.</em></blockquote><blockquote><em>You: “Yeah bro. It works, if no one will ever touch it again.”</em></blockquote><p>These projects remind me the legendary mouse trap from Tom &amp; Jerry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*horl1OUOWqDgwDglxlrBIg.png" /></figure><h3>When life gives you lemons...</h3><p>Often we have to cook using only water and the expectations are high. Here are a few notes, if the product/platform has been already sold to the client without clear understanding of requirements.</p><h4>Be aware of all Salesforce products</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*8eT9K_GHfdCoIOhHBauhSg.jpeg" /></figure><p>Should you tell the client to pause the project and help them find out what they are really looking for and how it would fit into their ecosystem? Should you be honest about product/platform limitations?</p><p>Salesforce is smart and has placed some limitations, which guide you into decision to buy additional cloud services. If you ignore these signals, there is high change you will end up developing stuff, that Salesforce has already developed. Yes, by the sound of it, there is a chance you will not end up building it better than Salesforce…or cheaper.</p><h4>Do you want extra fries with that burger?</h4><p>Sometimes sales rep is able to cross-sell Salesforce with managed packages. Then the real fun begins. As if focusing on platform limitations is not enough, now you have to analyse also custom product. Never underestimate this situation. Always involve <strong>external architect/consultant</strong> from the company, which has designed that managed package and use their knowledge as much as possible. They are expensive as hell, but only they know all the product limitations and landmines, that could sink your project ship a year (and $$$) later.</p><p>Be sure to do following:</p><ol><li>Collect <strong>corner case</strong> scenarios/performance blockers from the stakeholders (e.g. process .CSV file with thousands of records in near-real time)</li><li>Have some priority check about those corner cases with product owner. They might <strong>not be so important</strong> as they think. It is important to set <strong>real</strong> expectations in the beginning of the project, since product owners tend to overthink the solution during the project and may end up having unrealistic expectations (e.g. ability to reprice proposal with 1000000 different products).</li><li>Consult the tool expectations with <strong>external architect</strong></li><li>Repeat steps <strong>2 </strong>and <strong>3</strong>, till mutual agreement is achieved</li><li>Prepare to design the legendary mouse trap</li></ol><h4>You need to enable your inner <em>Expectations Manager!</em></h4><p>Every project usually starts with workshops to gather business scenarios, user stories, high level diagrams and visits to local dive bars.</p><p>During lonely nights in the hotel use the time to plan following steps:</p><ol><li>Based on the outcome, you should establish first version of <em>Decision Log, </em>where you either link candidate user stories with <strong>OOTB </strong>(out of the box) functionalities or <strong>mark them</strong> as “custom code needed”.</li><li>Take a second look on requirements and design alternative scenarios/stories in order to employ <strong>OOTB</strong> functionalities, where possible.</li><li>Explain to the customer the benefits of <strong>OOTB</strong> features vs. <strong>custom code</strong>.<strong> </strong>Be like <em>“Yeah, anyone with mouse can change the process configuration without those greedy and expensive developers, ‘haha’”</em>.</li><li>Present the <strong>alternative stories/requirements/scenarios</strong> and work on agreement to prevent custom code implementation. Everyone can change their mind, especially on requirements. As a consultant, you are paid to make life easier and kinda coach the client.</li></ol><p>Thanks to your experience, knowledge and persuasiveness, you can avoid reimplementing the wheel. Try to keep <a href="https://www.salesforce.com/au/blog/2015/01/moving-the-cliff.html">80–20 ratio with <strong>OOTB</strong> vs. <strong>custom code</strong></a> .</p><blockquote><strong>PRO TIP: </strong>Be especially careful, if client wants to replace standard object with custom object and spice it up with extensive code base to mimic standard features due to licensing. Make them aware of future consequences like inability to use managed packages, which won’t use replicated standard object.</blockquote><p>Do you have better ideas on how to manage these situations? Do you have examples, which you would like to share? Do you think I’m completely wrong?</p><p>Thanks for reading and please leave a comment!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f137c30440" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>