The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Choosing between Custom Metadata Types and Custom Settings for org configuration (opens in a new tab)

You will learn which configuration store fits deployment-time values, which fits per-user or runtime state, and how to migrate between them.

Why read this

The article gives a clear decision rule that you can apply when designing new configuration.

Custom Settings

  • Records are data, not metadata
  • Not in change sets or packages
  • Hierarchy cascade: org, profile, user
  • Count against data storage

Custom Metadata Types

  • Stored as metadata
  • Deploy with change sets and packages
  • Referenced from formulas and Flows
  • Apex cannot edit them at runtime
Custom Settings and Custom Metadata Types differ in how they deploy and in what they can do at runtime

Salesforce orgs need to store configuration that code reads, such as feature flags, endpoint URLs and thresholds. The article contrasts the two classic options, Custom Settings and Custom Metadata Types, and notes that choosing the wrong one tends to cause problems later, often during deployment.

Custom Settings hold org-specific data in two forms: List settings, which are sets of records, and Hierarchy settings, which cascade values from org to profile to user. The cascade is their main advantage, since it allows per-user or per-profile values without code. Their records are data rather than metadata, so they do not travel with change sets or packages, must be recreated in each sandbox and in production, are invisible to the Metadata API, and count against data storage.

Custom Metadata Types store configuration as metadata that deploys with change sets, unlocked packages and the Metadata API. They can be referenced from formulas, Flows, Apex and Validation Rules, and they support protected records in managed packages. Their limits are that Apex cannot create or edit them at runtime, and they have no per-user or per-profile cascade, so one value applies to everyone in the org.

The article’s rule is to ask whether the value changes at runtime or only at deployment. Runtime state such as counters or timestamps belongs in Custom Settings or a Custom Object, while deployment-time configuration belongs in Custom Metadata Types. Per-user or per-profile values call for Hierarchy Custom Settings. Many orgs combine both, using Custom Metadata Types for stable configuration and a Custom Setting or Custom Object for live state.

For migration, the author recommends creating the Custom Metadata Type with the same fields, recreating the records as metadata, and updating references, noting that the getInstance() call changes to the mdt syntax. Migrate one setting at a time, keep the old one until the new one is proven, and check that test classes still cover the code so the 75% deployment gate is not breached.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Running Apex tests on a local runtime, without an Org round trip (opens in a new tab)

You will learn what renmy runtime does, how it runs Apex and Flows locally against an embedded PostgreSQL, and which commands cover testing, debugging, AI agent integration and gated deploys.

Why read this

You will also see what the benchmark claims and what sits behind the Pro tier.

  1. Snapshot selected source into a bundle
  2. Run local validation and test gates
  3. Check-only validation in the target org
  4. Deploy the validated bundle
The gated deploy path from local source to the Salesforce org

Nimbus has been renamed renmy runtime, with the same tool and the same binary. It is a local Salesforce Apex runtime that executes real Apex, SOQL, DML and Salesforce Flows on a developer’s machine against an embedded PostgreSQL database. The runtime enforces platform rules such as governor limits, order of execution across triggers and flows, and per-test transaction isolation. It ships as a single binary for macOS, Linux and Windows and needs no org, Scratch Org, Docker or JVM.

The article’s benchmark compares four open-source Apex suites containing 837 tests. Run in a Salesforce org, they took about 1 minute 46 seconds, and locally they took about 2.4 seconds, roughly 45 times faster, with every test passing in both places. Around the runtime sit a language server that serves editors such as VS Code, Cursor, Neovim, Zed and JetBrains IDEs, a live debugger that supports breakpoints and stepping, and line and branch coverage reporting. Pro adds mutation testing, which the author says is the first of its kind for Apex, and watch mode. The toolkit also includes failure explanation and triage tools, a browser-based Dev UI, and a flaky-test finder.

For AI coding agents, renmy provides an MCP server with tools for running tests, executing anonymous Apex, reading coverage and explaining failures, so agents can verify Apex locally before anything reaches an org. The deployment path is gated: renmy deploy is free and snapshots the source, runs local tests and coverage gates, validates the same bytes in the target org with a check-only validation, and then deploys. The Pro renmy release commands split validation from deployment and produce a receipt that records the bundle digest, Git revision, gate results and the validation job ID, so a team can approve and deploy the validated payload from another machine. The article stresses that Sandboxes remain useful for end-to-end checks and user-facing testing.

The Free tier costs nothing without a card and covers unlimited local test runs, gated deploys, Salesforce CLI pass-through and IDE integrations on one machine. Pro, which adds the daemon, parallel runs, debugger stepping, mutation testing and the MCP server across three machines, and Team are both free during the public beta. Their list prices are $19 per month and $49 per developer per month, and Enterprise starts at $20,000 per year.

Read the original at dev.to (opens in a new tab)

Worth reading?