It is that time again, release notes and previews show us what is coming in the near future. And as you would expect, we have seen some truly remarkable additions to CRM Analytics (Tableau CRM) with the Salesforce Spring ‘22 release.
Category: Development
Code Sharing With Classes in LWC
There are some well-established methods for code sharing in LWC: We can compose entire UI components in the HTML template, or via Lightning App Builder. Or we can create a service component, and then export functions from that component (see the Developer Guide). But sometimes neither of those is appropriate
Common Apex Mistakes – Too many SOQL queries
As a Salesforce developer seeing the message “System.LimitException: Too many SOQL queries: 101” can be very frustrating.
In a large codebase it can be time consuming to find and fix these kind of errors. Even when your code is bulkified – why do errors remain?
They may only occur intermittently under certain circumstances, but none the less they still happen.
Continue reading “Common Apex Mistakes – Too many SOQL queries”
From Draft to Finished in Apex
Paul Gardner said “A painting is never finished. It simply stops in interesting places”.
This is 100% true of code. The finish is not the most important thing – when we seek to learn by looking at code, the steps along the way say much more than the end-product alone.
So, as I created a self-contained piece of Apex for a project, I thought that I would git-commit every step. I don’t claim that this code is perfect, but I hope that, by showing my working, it might stimulate thought/discussion. It certainly made me think about the reasons for each step, from draft to finish, more than I otherwise would have.
Clean Code – Code versus Comments
As developers we have a responsibility to ensure that any code we write can be easily understood. Especially by any other developer who may come along and take on our code. Not only that, but writing code in such a way that when we ourselves come back to it, we can still recall what it does and why it does it.
List Processing in Apex with map(), filter(), and more
Salesforce developers can hardly have avoided JavaScript in the past few years. And, if you’ve used JavaScript, you may have used their tidy methods for handling arrays.
Continue reading “List Processing in Apex with map(), filter(), and more”
Debugging For Salesforce Developers
A bug has been reported in production and there’s no obvious path to the problem. What are you going to do? A build process is failing and the errors make no sense. What are you going to do? A report is showing you things in the data that just shouldn’t happen. What are you going to do?
Using Lazy Evaluation to Write Salesforce Apex Code Without For-Loops
Functions or for-loops?
A developer working in Javascript has access to some really convenient functions on Arrays. Functions like filter() and map() can avoid the need to write for-loops. Is this actually a good thing? Can we write Apex this way?
Continue reading “Using Lazy Evaluation to Write Salesforce Apex Code Without For-Loops”
Got Alignment Issues on iPhone?
There’s nothing worse than building a beautiful email template only to find out it breaks on certain devices. I’ve come across this very strange alignment issue on iPhone repeatedly over the years. If you’ve seen it too, I also have the fix!
Parameterised Dependency Injection via Custom Metadata Types
Dependency injection using Custom Metadata Types is a great way to write code on Salesforce that is easily extensible. Even if you never actually end up extending your design Continue reading “Parameterised Dependency Injection via Custom Metadata Types”
Performance Testing of Process Builder vs Apex
The choice between writing custom Apex code or using declarative tools in Salesforce has always been a difficult one to make. Process Builder is capable of more than Workflow was, but it came at a big performance cost. In this article, Roger Mitchell measures that performance cost again. And it looks like things have improved considerably since 2016. Continue reading “Performance Testing of Process Builder vs Apex”
More ‘Out of the box’ Community Themes
When Lightning Communities were first introduced back in October 2015, there was only one theme available, Napili. This was great because it was a simple responsive theme with a few customisable options. Continue reading “More ‘Out of the box’ Community Themes”