Skip to content
Flux Forms

Home / Admin setup

Approve Apex handlers

Let a purpose approve Apex classes a form may run on submit, the same way it approves flows.

For Salesforce administrators.

Alongside its flows, each purpose has an Apex actions section: the Apex classes a form using that purpose is allowed to run from a submission action.

This is how you extend Flux Forms with logic that is easier to express in code than in a flow. It is also what makes on-demand flows reachable at all.

Adding one

  1. Open the purpose in Purpose Manager and click Add Apex handler.
  2. The dialog lists the classes in your org that implement the Flux Forms handler interface. You never type a class name. If the list is empty it names the interface a developer has to implement, fluxforms.SubmitActionApexHandler.
  3. Pick one. The dialog shows the inputs and outputs the class declares, with their types.
  4. Give it a Display name — this is what marketeers pick from — and Save.

The handler appears in the Apex actions table with its input and output counts.

Maintaining them

  • Adding the same class again updates the existing row rather than creating a duplicate. That is how you refresh the contract: if a class's inputs or outputs change, add it again.
  • The row action removes a handler. It stops being offered in the builder immediately.

A stale contract behaves like a stale flow contract. The builder maps inputs and outputs by the names captured when you approved the class, so a class whose signature moved on and was never re-added is a common cause of a failed submit action.

Why approval is required at all

Running Apex is at least as powerful as starting a flow, so it goes through the same whitelist. A class that is not approved on one of the form's purposes cannot be saved into a form and cannot run — the builder offers no free-text box, and Save rejects a configuration that names an unapproved class even if it were edited in by hand.

Approving a class needs configuration-admin access, which is the same bar as writing one.

What the marketeer sees

Once a handler is approved and the purpose is assigned to a form, the Run Apex action offers it, with its declared inputs and outputs selectable exactly like a flow's variables. See Run Apex actions.

If a form's purposes approve no handlers, the action type explains that and points at Purpose Manager.

Tell your developer this one thing

The class and its methods must be global — class, both interface methods, and an explicit global no-argument constructor.

A public class compiles perfectly and then simply never appears in the picker, with nothing on screen to say why. It is the single most common setup mistake, and an empty picker is the symptom.

Last updated: 2026-09-10