Validation flows for wins

The record-triggered flows with Custom Error element has been introduced a while back (Winter ’24 actually). I immediately saw their benefits but didn’t see many use-cases I would need them for.

The first use-case, when it was tempting, was a requirement to allow progress of opportunity into next stage only when products are added. Great use-case, but there is better OOTB functionality – the HasOpportunityLineItem which can be true or false.

But finally I got a bunch of great use-cases on current project, which are actually at the end linked together.

Use-Case #1 – validation of selected values

On account the customer has a multi-select picklist to choose industries, where the company is active. On opportunity they want to select for which specific industry it will be used. It is a single select and there is an obvious requirement for the user to be able to choose only something which is listed on the account.

Yeah, multi-select picklist, you can already smell it won’t be possible to check in validation rule. I mean it would be but you would need to list all the choices and compare, I didn’t find a way how to create a simple and universal validation rule.

Luckily, there is a before-save flow, where you can assign the multi-select into one variable and check whether it contains the value from opportunity, if not -> custom error.

Solved!

Use-Case #2 – limit the list of choices in the picklist

The list of the industries are fashionably long and when you are creating the opportunity you might not remember what is selected on the account. Especially if you are creating it from the menu or global action.

But hey, there is no way how you can make the picklist on opportunity dynamic, unless you want to develop it as custom component and then you have a challenge how to incorporate it nicely into the form.

Never mind, we have the flow above with the custom error and in the error we can list the industries from the account. Not a perfect solution as first save is rather a try, but on second save you know from which values you can choose.

Actually, with the right question we quickly found out that majority of accounts have just one industry. At that moment the solution was simple – in the before-save flow first check if there is only single industry, in such case set the industry on opportunity. If there are multiple check whether they selected the right one and if not give them a help text with suggestions what they can use.

Use-Case #3 – when progressing into next stage an activity has to be planned

Historically we would use something like DLRS to count the number of future activities linked to opportunity and build a validation rule linked to that field. Which would mean daily recalculation of all opportunities and other ugly things.

Luckily, before-save flow, which triggers when Stage is changed, query related activities with future date and if the collection is empty shows the custom error.

Similarly you can check whether this is first opportunity or another for the account and set/require the right type of opportunity.

Happy End

What started as super unhappy customer quickly iterated to something pretty usable what the customer is willing to accept as a nice solution. Thank you Salesforce and especially the Flow team for extending the platform with such goodies!

Napiš komentář, díky!

My Notes from CRMs Side to Side

At Actum we have Salesforce and Microsoft division, which gives us the unique benefit of being able to propose CRM solutions on both platform (actually we can do SAP as well). It also means that Salesforce isn’t really happy and I’m not sure about Microsoft.

Anyway, the other day we have been preparing with Karel (the Delivery Director of Microsoft division) another RFP, where customer wanted quotation for both platforms and Karel wasn’t really happy with the estimates I’ve been putting together. The idea has been born – let’s compare the solutions side by side.

It took a bit longer to prepare everything, after all the summer period is usually a bit slower and we’ve been busy on projects. At the end of summer Adam (the Kentico Division Director) agreed to be our customer and put together his requirements for CRM system, based on which we should configure the systems live from scratch.

Beginning of September roughly 50 people have been registered for the event, majority of them attended on-site and we had a few on-line people as well. The start of the event was a bit stresful as the meeting room got cleared just minutes before start, we didn’t have time to test the beamers (they don’t really work on black wall) and a few other things, but at the end we started basically on time.

Karel, Adam and myself on the stage, room full of people

As I’ve been presenting I didn’t really have time to pay close attention to what Karel is doing, from my point of view the solutions are almost equal, each of them has their own benefits which you might or might not appreciate. A feedback I’ve got after the event was, that it feels like you need to click more on Microsoft to set it up and Karel had a bit challenge to keep up with me configuring the system. But that’s not something you’ll really appreciate in daily live.

My key takeaways:

  • The security has mostly the same possibilities – object, row and field level;
  • Microsoft speaks a lot about their Dataverse, we have Platform but doesn’t really stress its importance that much;
  • The business process definition on Microsoft is awesome! It can be dynamic with conditions, so the moment the opportunity is above some value or has any other condition you can extend the business process. On Salesforce we can use record types to achieve it, but that’ll be pain;
Microsoft Business Process definition screen
  • Salesforce has more flexible and easy to configure UI – the Lightning Pages are just so easy to configure and so flexible. Microsoft is mostly about two columns with fields and tabs with additional related info, you can definitely develop your own component in JavaScript, but probably nothing as easy to use as screen flow. And the design is kind of spartan;
  • Power Automate on the other hand is superrior to flows – all the connectors, the fact that it records all the calls so you can update the definition and just re-run based on the saved data, no need to trigger is again. Which might be beneficial when being called from external system and in plenty of other situations. It also shows the timing so you know where to focus with your optimization. Yes, we have the MuleSoft Composer, but that’s extra money and don’t have that many prepared integrations;
  • Native connection with Teams, not just for the chat but also for calls, another benefit of Microsoft. And based on the presentations from Dreamforce Salesforce is aware of that and when positioning Slack they don’t compete agains the telephony part;
Slack and Microsoft Teams
  • Training is probably stronger on Salesforce, Trailhead is just awesome. Microsoft has something as well, it isn’t the old good text documentation but something more fancy, but still not on-par with Trailhead;
  • At the beginning it looked like Experience Cloud is something where they cannot compete but at the end Karel was able to quickly spin-up something as well;
  • Development, sandboxes, pipelines, etc are similar, on Microsoft platform you are limited by the allocated space into which all your data needs to fit;
  • Licenses are similar as well – not speaking about the absolute price, as we didn’t speak about it, but about their variation for different use-cases.

At the end Adam as our jury decided it was a tie with each platform being slightly better at some areas but generally speaking both were really good. Obviously the sample scenario was super easy, at the same time what we see in real life customers aren’t usually more complex as the platforms bring most of the features out of the box.

It also looks like an important event for the wider community as potential customers are still getting in touch with us asking for recording or whether we can run it for them again. And we are definitelly happy to help with finding the right solution, our System Integration division can run technology agnostic discovery of needs and at the end compare the solutions and clearly say why they propose one of them, including TCO calculation.

Slighly selling end, but it happens and I really enjoyed this event. Does it make sense to compare Teams and Slack or who cares?

Napiš komentář, díky!

Winter ’25 Release Notes

Winter '25 Release Notes

Magic happened over the weekend and most of my customers got a new version of their Salesforce. This time I was prepared as I read the release notes on my way to Dreamforce – what a great reading for long flight!

What are the goodies I noticed?

  • Default No-reply address in Organization-Wide Email Address settings has to be verified otherwise some emails won’t be send. Last release similar enforcement has been put on users emails and we stop receiving some of them, which was weird as we kept getting them from other users, the DKIM verification helped there, but be prepared;
  • Get Flexible Access to Custom Apps with the Salesforce Platform Login License – this is mega awesome, the login license has been available for Experience Cloud but not for normal licenses, which made it expensive for some client. This might be the answer, that anyone in the company can have access to Salesforce, but you will pay only when they will use it;
  • Save on Storage and Boost Performance with Salesforce Archive (Pilot) – this is kind of surprising move (maybe not, when you consider Own acquisition) and only available in some regions for the moment, but with right pricing and nice integration that can be super cool;
  • Do More with Custom Report Types (Beta) – the UI is SOOO nice now, I love it!
Custom Report Types new UI
  • Configure Record Highlights in Lightning App Builder – not just a replacement for the Compact Layout, but the fields can be dynamic and there can be 12 of them! (instead of 7 till now);
  • Make Record Fields Stand Out with Conditional Formatting – wow, color formating of fields or extra icons based on value in a fields. Another reason why UX Designer experience will be more important, otherwise we will create something ugly but colorful;
  • New Regional English Variations – not sure why we got English (Czechia): en_CZ language variation, they probably wanted to make jokes of our Czenglish so I should try to find out what is the different compared to normal English (actually first I need to define „normal“);
  • Include More Attributes in Your Activation to LinkedIn is related to Data Cloud which can have better chances to find contact’s profile on LinkedIn;
  • Track Apex Unexpected Exceptions with Free-Tier Event Monitoring – „free“ sounds weird from Salesforce but looks like we will be somehow able to get rid of the error emails and troubleshot our Apex code more easily. Need to check Nebula Logger whether it already uses it;
  • Empower Mobile Workers with Data Capture Forms (Beta) – this is something for Field Service and looks like a great replacement for regular Screen flow;
  • Launch Flows Silently Based on Geolocation – the platform of Field Service will just trigger the flow automatically based on changed GPS location. I can see some use-cases to simplify life for technicians;
  • Enroll Admitted Students into Learning Programs – as we are just finishing implementation of Education Cloud, this was definitely something we’ve been missing and had to develop. Roll back to standard or just keep or functionality?
  • Monitor Learners with Watchlist Tracking – actually, the beginning of the description (proactively monitor learners who require enhanced support) sounds way better than the rest (select the records related to the learners that you want to add to the watchlist);
  • View Academic Highlights with Learner Progress Summary – again looks like something we just developed 🙁
  • Accelerate Degree Planning with Learner Pathway Templates – do I need to repeat myself? What a bad timing for the project;
  • Clarify Prerequisites and Corequisites in Intelligent Degree Planner – not sure we developed this, maybe just partially, that would be cool to use!
  • Help Learners Make Informed Decisions with the Intelligent Program Comparison Engine – wow, wow, wow, what a promising feature!
  • Strengthen Prospect Engagement With Recruitment Inquiry and Opportunity Management – yeah!
  • Boost Your Sales Productivity with a Seller-Focused Mobile App – look, look, there is a new mobile app for Salesforce! Cannot find it at AppStore yet;
  • Optimize Your Strategic Planning with Account Plans – will be available in mid November and … looks like something we just delivered to different customer 🙂
Account Plans
  • The Campaign Member Status Chart is Being Retired – I don’t see retirement of features often enough, this is kind of surprising, but why not, right?
  • Streamline Collaboration on Shared Deals with Trusted Partners – this is interesting, looks like org-to-org replication of selected data, first you select the records in partner portal and then it’ll get synced into your org with only fields you select to be kept in sync. Limit of 50 vendors and 50 partners per org;
Shared Deals
  • Expand Your Email Reach by Using CC and BCC Options in Send Email Action – good bye times when flow could send emails only to 5 recipients, 150 to be it now! And CC and BCC supported as well;
  • Transition to the Lightning Editor for Email Composers in Email-to-Case – not enforced update but looks like some great features in the editor including Emoji (because who can survive without them these days), full-screen mode (focus is everything), printing (no idea), and much cleaner visual experience. Sold!
  • Find Your Next Customer with Prospecting Center, a new Data Cloud App – interestingly enough, this feature is available to „This feature is available to Sales Cloud users who have Prospecting Center enabled“ and doesn’t speak much about Data Cloud. Yes, Performance and Unlimited editions only;
Prospecting Center

What others found interesting

Napiš komentář, díky!

Consultants & Developers = ❤️

I’ve been so proud on myself the other day when I created this complex flow.

So disappointed when it crashed in production due to Apex CPU limits.

Double proud when I redid it into a combination of flow and Apex.

Let’s find out what and why, but before I’ll tell you my story watch this awesome presentation, which will present you the solution and how consultants and developers can work together to deliver awesome-ness.

The Challenge

My customer wants to generate invoices in Salesforce on monthly basis, they will manually go through the list of opportunities in the month and select opportunities which can be invoiced.

Each invoice can contain multiple opportunities, meaning there is just one invoice per client per month.

If that looks easy (it kind of is), each OpportunityLineItem can be invoiced to different client, in such case the opportunity isn’t linked to the invoice, only the lines.

The Process

The flow was kind of complex.

  1. get all opportunities which are completed but hasn’t been invoiced yet;
  2. present them in screen flow data table so the user can select those to be invoiced;
  3. go throught the selected opportunities and collect unique accounts (sadly we cannot do aggregated query);
  4. go through line items for the selected opportunities, if they are invoiced to account and collect unique accounts from here;
  5. get invoices which has been created for this months already – as the user can select maximum of 200 opportunities (due to data table limits) it might happen that invoice for this account already has been created;
  6. create an invoice for each unique account;
  7. go through the selected opportunities and assign the created invoice;
  8. go through the line items for selected opportunities and assign the created invoice;
  9. success!

What I found out during the process is how limiting it is, that you cannot use something developers call Maps. How limiting it is to loop through opportunities to collect unique accounts as we cannot do so-called aggregated queries in flow. As we cannot use Maps we need to use the Filter element in the flow to filter that one invoice. That it is super slow to loop through all the records. The fact that there isn’t the 2000 process elements limit anymore is cool, but it will drop on CPU time anyway. If you want to get around CPU time you can show screen after some number of iterations as it will reset the limits, but it is annoying to user.

The Solution

You know the solution because you watched the video – it is called Invocable actions. In my case it meant that I went from the flow on the left handside, which took be roughly two days to create and redo, to the combination of simple flow and simple Apex (ok, probably not the best code) on right handside, which I put together in roughly an hour.

The power of Invocable actions - it simplifies flows radically

Learning

It isn’t that hard to write the invocable action, but there are a few surprising moments (which can be seen on the picture above as well).

  1. the method parameter isn’t List<Id> as one would expect when passing multiple records, but List<List<Id>> where the outer list has just one value;
  2. suprisingly you cannot pass the list of selected records directly from data table, I had to loop through them in the flow and add them into another variable, which I was able to pass.

Go for it!

Yes, my dear consultant, there is no reason to be proud on yourself that you created something super complex with loop inside a loop inside a loop. Speak with your friendly developer, who can easily do aggregations, sub-queries, use Map to quickly go through records and all of that in a fraction of time it would take to you. And it will have better readability and at the end less of technological debt.

This is the way to go. And second time you’ll find out you can write it on your own. Because you are the best!

Napiš komentář, díky!

Se Zdeňkem Pejcelem

Zdeňka určitě znáš. Pokud ne, tak bys měla vědět, že pracoval v Salesforce, vybudoval nejrychleji rostoucího Salesforce partnera v Česku a prodal ho, odskočil si na Saharu, zkusil přechod Pyrenejí, koketuje s budhismem, skončil v blázinci, rozvedl se, koupil nové auto, má další plány a spousta dalšího, zdaleka ne v tom správném pořadí.

Martin a Zdeněk v lese

Spoustu otázek jsme nepokryli a napadly mě až zpětně, spoustu decentně přeskočili takže pardon, ale nikdo neříkal, že ho slíkneme do naha.

Má to dvě a půl hodiny, takže ideální čas na středeční dopoledne, do oběda stejně daleko. A dej vědět, pokud jsi doposlouchala až do konce.

Odkazy, které zazněly:

Napiš komentář, díky!