I’ve been working with non-Salesforce tech people on Salesforce projects lately. The one feature that blows them away is Flows + Invocable Methods.
That, my experience with B2B Commerce LE and the videos on SOLID principles got me thinking:
What if I think in terms of flexible modules instead of complex code?
The idea is to build complex business processes from encapsulated methods/modules which are strung together in Flows.
In the past, I had to think about all the business process permutations ahead of time to get them into code. More often than not the code became an entangled mess.
Alternatively I tried to do everything in really, really complex flows, nothing better than a mess of code.
I design and build many small encapsulated methods first, expose them as Invocable methods and do the complex orchestration later.
Based on a positive response from a Credit Score Service a discount of 5% needs to be applied to all Quote Line Items with a Product Family “PC” if the sum of these Quote Line Items is higher than 50.000€.
Past: All Logic in Code
1) Invocable Method “Credit Score Service”
– Input: Name + Address
2) Invocable Method “Apply volume Discount to Quote Line Items”
– Input: Discount Percent, Product Family, Threshold
-> A lightweight flow that strings it together.
I think, even if you orchestrate it together with Code instead of Flows thinking in “Modules” makes for a great experience.
What is your experience? Anything I’m missing here?
PS: Matthew Gerry videos on Solid principles were an amazing inspiration for this inner development.
PPS: I’m a firm believer, that heavy lifting should be done in code, but the surface-level business processes can be done using Flows.