In September of 2020, with the COVID-19 pandemic raging globally, I made the decision to start more actively contributing to Salesforce open source projects. Several months later, I open sourced Apex Rollup, and last year added Salesforce Round Robin to the mix. This year has been largely about supporting the growth of both of these projects, as well as continuing to contribute to and support open source classics like Nebula Logger, which appears on track to join the top 5 most-starred GitHub...| www.jamessimone.net
Open source work is an incredible way to build up a corpus of referenceable work when applying to jobs, but there are other reasons you might want to build up a portfolio of Apex-related code. Learning how to package and distribute code, for example, or giving yourself the chance to show off a piece of functionality you're particularly proud of.| www.jamessimone.net
There are a few limitations when it comes to the History records created by default when Field Level History is enabled for an object, not the least of which is history records not being created in tests. This can make testing logic out that employs History records difficult to approach, especially from a Test Driven Development standpoint - but it doesn't need to be so hard. Join me as we walk through how to setup an easily reuseable implementation for mocking History records and retrieving ...| www.jamessimone.net
One of the best thing about using strongly typed query builders is the type-checking that you get -- for free -- while using them. Type-checking not only prevents you, as a developer, from making a mistake -- it also prevents admins from updating the API name for a field or from being able to delete it while it's referenced within your Apex code. Even if there were no other use for the `Schema.SObjectField` class, those two reasons alone would make it worth our while when deciding when to use...| www.jamessimone.net
At the end of 2020, I decided to take 2 weeks off of work at the end of the year. I was very fortunate to be able to do so, and I found myself in the position of wanting to give back. I'd had to replace DLRS within the org for the consulting company I was working for several months previously, and the idea of creating a more performant rollup engine was an alluring way to do so. The simple `RollupCalculator` class I'd made seemed just a _few_ lines away from a much simpler implementation than...| www.jamessimone.net
My manager and I met up the other morning for a paired programming session. We had two possible things to work on and decided to embrace Kent Beck's 'start small, or not at all,' by focusing on a seemingly innocuous task -- adding the disabled attribute to a lightning-button in one of our Lightning Web Components (LWC). Even with strict adherence to TDD, this is a task that should take only a few minutes; it's not a complicated component, and the change is extremely straightforward. Would it ...| www.jamessimone.net
Expressing intent through naming is a challenge, but well-named methods can help to expose even the most complicated of programming mechanisms. In programming, as in life, context is key - let's explore how naming can elevate the intent and rationale behind code! Whether you're just beginning your programming journey or you're a veteran programmer of many years, it's my hope that there's something in this post for everybody.| www.jamessimone.net
Calculating time differences correctly is challenging. With more than two dozen time zones at play on any given day around the world, and yearly / historical fluctuation in time, it's no wonder that Salesforce stores dates in GMT and tries to enforce good practices surrounding time and date calculation by giving you -- the developer -- quality date/time APIs when dealing with them. When working with formula fields in Apex, however, the developer must keep in mind certain idiosyncracies in ord...| www.jamessimone.net
Batchable and Queueable Apex are both powerful processing frameworks within Salesforce. Unlock the power of both Batchable and Queueable Apex with the easily extendable DataProcessor pattern.| www.jamessimone.net
Learn about Apex from the ground-level upwards: the basics of object-oriented programming, static types and type inference, virtual and abstract classes, interfaces, polymorphism, encapsulation and inheritance.| www.jamessimone.net
The abstract enum class in Apex can be very helpful as a class-like object, but there are a few things you should keep in mind to avoid getting bitten by the use of enums.| www.jamessimone.net
Tap into the power of the Trigger Handler pattern in Salesforce with this extremely lightweight Trigger Handler framework.| www.jamessimone.net
We often hear the word idiomatic applied to programming languages to express the language-specific way of accomplishing routinely encountered problems. In this post, we dive into how to write idiomatic Salesforce Apex to make the most of each line of code.| www.jamessimone.net
Cover the basics of mocking DML operations through the use of a DML class that can be swapped in unit tests.| www.jamessimone.net
Dive into the philosophy behind unit testing in Apex, and why writing good tests is so important.| www.jamessimone.net