To my surprise, GitHub Copilot is an astonishingly good tool for developers. In this post, we will look at some AI history and context, then get into some example interactions of coding with Copilot.
Category: Apex
Maps in Flow
Maps are a fundamental data structure in Apex and other programming languages. They allow us to store a series of key/value pairs, and then efficiently use a key to look up a value from the store. There is no built-in map construct in Flow, but it would be useful if there were. So, I built one!
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”
Flow for Developers
Rivers, and paddling them in a canoe, can teach you important lessons about going with the flow. You’re never going to successfully paddle upstream against the Yukon (trust me – I’ve been there). Poor communication with a tandem canoe partner can make you both end up swimming. If you get pinned sideways, you must lean in to the obstacle.
The most important lesson, though, is the first one: Go with the flow. Let the river guide you. Work together to get the boat where it needs to be. All that power, blended with a bit of control, can have beautiful results.
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”
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”
SObjectIndex – The Class You Can Use Everywhere
There is one Apex class in our Nebula library that we use more than any other: SObjectIndex. It is a generalisation of something that will be familiar to most Apex programmers: a Map of Ids to SObjects.
Continue reading “SObjectIndex – The Class You Can Use Everywhere”
Salesforce Automation Overview
Salesforce Automation Overview
Salesforces success is largely due to its unrivalled customisation options. The CRM solution can be moulded to your unique business processes, allowing for immeasurable customisation options.
Salesforce doesn’t break this trend when it comes to automation. Continue reading “Salesforce Automation Overview”
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”