Skip to content

Introduction

After years of developing Salesforce projects, we noticed that the same problems appear again and again. Many of these challenges have already been addressed by the Salesforce community, resulting in a variety of open-source solutions. One of the most popular approaches, FFLIB, can be found in countless Salesforce implementations.

The challenge, however, is that FFLIB was created over a decade ago and has not fully evolved alongside modern software development practices. While newer frameworks offer strong alternatives, they are often scattered across multiple repositories and lack a single, unified approach to solving common Salesforce challenges.

We decided to create something completely new: a cohesive, modern solution that addresses the majority of challenges any Salesforce project may face—whether it is small or enterprise-scale.

Apex Fluently is a collection of open-source Salesforce libraries designed to make development easier, faster, and more maintainable. All frameworks included in the package use a Fluent API that resembles natural, English-like notation, making them extremely easy to read, understand, and adopt.

Clear rules and thoughtful, intelligent implementations help prevent common development mistakes, while still preserving flexibility. This allows you to choose the Apex Fluently approach that best fits your needs-without sacrificing control, clarity, or scalability.

What Does It Solve?

  • Long-Running Unit Tests - Mock SOQL and DML results.
  • Too Many Queueable Jobs - Manage asynchronous processes.
  • You Have Uncommitted Work Pending - Commit work after a callout.
  • Too Many SOQL Queries: 101 Error - Cache query results and minimize the number of queries.
  • Too Many DML Statements - Gather records and commit them together to reduce DML statements.
  • Complex Test Data Creation - Use mocking features to avoid data creation.
  • Code Readability - Avoid conditional statements and extra variables—write less to do more.
  • Exceeded Salesforce Limits - Query caching, auto DML bulkification, and async job management to minimize limit usage.
  • Technical Debt - Reduce and manage your org's technical debt.

Why Apex Fluently?

  • FFLib Better Alternative - A modern approach that follows current development practices and addresses the limitations of FFLib.
  • Led by Beyond The Cloud - Open for contributions and new ideas, but every change is carefully reviewed to match the highest code standards.
  • Fluent API - Each library has a fluent API, which makes it extremely easy to use.
  • Production-Ready - All libraries are battle-tested in real-world Salesforce environments.
  • Fully Tested - We have almost 100% code coverage for all our classes, checking many different scenarios.
  • Actively Maintained - Regular updates and community support, with full support and fixes within 24 hours.
  • MIT Licensed - Free to use in any project, commercial or otherwise.
  • Performance Improvements - Our libraries think on your behalf. Auto-bulkification to save limits and custom exceptions to prevent common errors.

Our Libraries

We currently maintain 8 libraries that complement each other. However, each library can be installed separately. There is no dependency between them.

Apex

  1. SOQL Lib - Dynamic SOQL query builder
  2. Async Lib - Asynchronous operation handling
  3. DML Lib - DMLs management
  4. HTTP Mock Lib - HTTP callout testing utilities
  5. Apex Consts - Type-safe constants
  6. Cache Manager - Platform cache management

LWC

  1. Toast Builder
  2. Error Service

Installation

See the Installation Guide for detailed instructions.