fix(workflow): show fields for system objects in record-updated trigger (#21826)

## Problem

On the **Record is updated** (and **upserted**) workflow trigger,
picking a record type under the **Advanced** submenu (i.e. a *system*
object) showed an empty "Fields (Optional)" list — you couldn't select
any field to watch.

## Root cause

The trigger's field picker (`WorkflowFieldsMultiSelect`) was called with
`actionType="UPDATE_RECORD"`, which runs each field through
`shouldDisplayFormField`. For `UPDATE_RECORD` that predicate requires
`(isUIEditable ?? true)` — correct for the *Update Record action* (you
can't write to a read-only field), but wrong for a *trigger*, where
you're choosing which fields to **watch for changes** and editability is
irrelevant.

System objects define their fields with `isUIEditable: false`, so every
field failed the gate and the list rendered empty.

## Fix

Add DATABASE_EVENT trigger type to separated from action type.

The `UPDATE_RECORD` / `UPSERT_RECORD` action paths are untouched.
This commit is contained in:
Thomas Trompette
2026-06-19 11:48:14 +02:00
committed by GitHub
parent 8ff494e5e8
commit ceecae30db
4 changed files with 57 additions and 4 deletions
@@ -24,7 +24,7 @@ export const WorkflowFieldsMultiSelect = ({
handleFieldsChange: (field: FieldMultiSelectValue | string) => void;
readonly: boolean;
defaultFields: string[] | undefined | null;
actionType: 'UPDATE_RECORD' | 'UPSERT_RECORD';
actionType: 'UPDATE_RECORD' | 'UPSERT_RECORD' | 'DATABASE_EVENT';
hint?: string;
}) => {
const { getIcon } = useIcons();