There comes a time in every Salesforce implementation when the native lead conversion functionality needs to be extended. Most frequently, this is the result of needing to perform lead conversion in bulk. Lead conversion tends to be a slower process, and an unbulkified process runs the risk of timing out. This makes sense - the worst case scenario involves a contact, account, and opportunity being created, as well as the lead being updated. That's a lot to take care, under the hood! Let's div...| www.jamessimone.net
I recently revised the original Factory pattern article, and wanted to write a follow-up after a few years' spent reflecting on its usage within Apex. In particular, I'd like to talk a little bit about the Singleton pattern, and how with a small amount of work we can enhance the existing Factory class in order to gracefully create cached instances of classes where a large amount of work goes into constructing them.| www.jamessimone.net
Following up on the Object-Oriented Basics post, this time we switch our attention to interfaces and abstract classes - when to use them, when to avoid them, and how to distinguish between them. Learn all about what makes an interface successful, how to consolidate logic in abstract classes, and more!| www.jamessimone.net
Assignment, be it for Leads, Cases, or custom objects in Salesforce, doesn't always conform to out-of-the-box offerings. I've seen a few places where OmniChannel didn't quite align with a company's business rules; where Lead Assignment Rules didn't offer the capabilities necessary to properly assign an owner. One common example of this is the so-called 'round robin' assigner, where a company's leads (or any other object) need to be assigned fairly between a number of sales reps. In this artic...| www.jamessimone.net
Structured Query Language (SQL) and the basic Salesforce equivalent, SOQL, share many commanalities. Each has the ability to pull data back from the database through the use of specialized keywords. SOQL has many peculiarities, not the least of which are the limits the aspiring developer is under when using it. What may seem like one of the best features of Apex -- its seamless integration with SOQL -- is, however, unusable when it comes to producing truly dynamic and flexible queries. As wel...| www.jamessimone.net
Flows are increasingly a part of the Salesforce automation picture, and their seamless melding with Apex through invocable Apex is part of the reason why admins and developers alike are embracing Flow. Learn how easy it is to make simple, reusable Apex invocables, taking advantage of patterns to avoid tight coupling and code duplication.| www.jamessimone.net
A few months ago I was tasked with replacing Declarative Lookup Rollup Summaries (DLRS) in an org suffering from frequent deadlocks. Rollup summary fields in Salesforce are plagued by severe limitations -- only being available on master-detail relationships being just the start of the list. Read on to learn about how I built Rollup to assist in orgs looking for DLRS-like flexibility with a much smaller performance overhead, complete with elastic scaling (go fast when you need to, slow when th...| www.jamessimone.net
The Singleton pattern is frequently used to represent objects that should only be initialized once; either because in being constructed, they feature CPU intensive operations, or because they revolve around atomic operations (like logging a specific time) that should always be referenced consistently. Learn how to improve upon the idiomatic Apex singleton pattern in Salesforce to reap performance benefits and save lines of code at the same time!| www.jamessimone.net
Learn more about performance testing the CRUD framework, the cost of sorting, and how to implement custom sorting easily.| 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
API development in Apex is mostly bespoke, requiring the duplication of rest resources. Let's look at how we can change that using inheritance and polymorphism to power our routes. Using extendable, dynamic APIs give us a huge amount of flexibility in spinning up new HTTP routes within the /apexrest/ path, letting us write code that external teams can stress-test and experiment with faster.| www.jamessimone.net
Structuring your unit tests to run fast in Salesforce's Apex programming language is crucially important when designing large systems, allowing you to quickly iterate and successfully refactor.| www.jamessimone.net
Synchronous apex methods typically use asynchronous future methods to perform API calls, or callouts in Apex. This article covers the best way to execute performant HTTP-related code, while allowing for further processing to be done. It makes use of the Queueable interface in Apex, and shows how to implement the Queueable interface with the least amount of boilerplate.| www.jamessimone.net
Learn how to use Repositories to protect your SOQL usage and easily swap implementations in unit tests| www.jamessimone.net
Surfacing Apex exceptions through a dedicated logging platform so that exceptions in your Salesforce code can be easily monitored.| www.jamessimone.net