Skip to main content

Bulk edit

Bulk edit turns a screen's grid into an editor: cells are changed in place, rows are added, cloned, copied, pasted or marked for deletion, and a single Save writes everything — through the same queries as the dialog, with the same row hooks.


At a glance​

CustomersSave (3)CancelAdd rowImportCopy (1)Paste (1)Delete selected (1)IDNameCountryStatus+⧉×ACMEFRActive●⧉×1002Beta SARLBEProspect−⧉×1003Gamma LtdUKInactive⧉×1001ACMEFRActiveBulk editSave writes every changeClone rowa sequence key left emptyTicked rowscopy, paste, deleteNew rowadded at the topEdited rowcells edited in placeMarked for deletiondeleted on Save; × undoes

Opening bulk edit​

The grid's toolbar shows Bulk edit when the screen has an update or an insert query — Edit when the screen has no dialog. The button is hidden on a screen that is read-only or whose editable setting is off; the server's permissions still apply on top.

In bulk edit, the toolbar becomes:

ButtonEffect
Save (n)Writes the pending changes; n counts the edited, new and deleted rows.
CancelDrops every pending change and leaves bulk edit.
Add rowAdds an empty row at the top of the grid, filled with the columns' default values.
ImportReads an Excel or CSV file into the grid — see Import a file. Shown when the screen allows imports.
Copy (n)Copies the ticked rows.
Paste (n)Adds the copied rows as new rows.
Delete selected (n)Marks the ticked rows for deletion; a ticked new row is simply removed.

Add row, Paste, Clone row and Import need an insert query and are hidden when the screen disables adding. A refresh of the grid ends bulk edit without saving; the copied rows stay available.

Rows and cells​

Each row starts with a check box, a marker and two buttons:

ElementMeaning
+A new row, not written yet.
●An existing row with edited cells.
−A row marked for deletion.
Clone rowAdds a copy of the row at the top — see Clone, copy and paste.
×Marks the row for deletion (a second click undoes it); on a new row, removes it.
PadlockThe row is read-only: the screen's editable_when rule excludes it, so its cells stay plain and it cannot be deleted.

A cell stays read-only when its column is disabled — disabled, or disabled_when for the row's values —, or locked for that kind of row: disable_on_add on a new row, disable_on_edit on an existing one. See Conditional fields.

Clone, copy and paste​

Clone row, and Paste of copied rows, add new rows that keep every value of the source, keys included — copy a row, then change the one value that differs. The only exception is a column filled by a SEQUENCE rule: it is left empty, and the insert takes a new number from the sequence; the related one-to-one tables of the screen follow that new key.

A row born from a clone or a paste is a duplicate: on Save it fires the screen's on_duplicate hook, with the source row's values under SOURCE_<column>, exactly as the dialog's Duplicate does — see Actions and lifecycle.

Paste from Excel​

Cells copied from Excel (or any tab-separated text) and pasted into the grid — with no cell being edited — become new rows:

  • when the first pasted line matches at least two column headers, it is read as a header line and each value goes to the column of that name, whatever the order;
  • otherwise the values follow the order of the visible columns, as an export of the grid lays them out.

A column with a lookup fills its dependent columns from the pasted code, as when the code is picked in the list.

Import a file​

Import in bulk edit reads an Excel or CSV file whose first line holds the column headers. A line whose key columns match a row already in the grid becomes an edit of that row; the other lines become new rows. Nothing is written until Save, so the result can be reviewed and corrected first.

Outside bulk edit, the toolbar's Import opens the Import dialog instead, which checks every line against the screen's rules before saving — see Bulk import.

Save​

Save writes the rows in one pass:

  • each edited row through the update query, each new row through the insert query, each row marked for deletion through the delete query — together with the columns stored in the screen's related one-to-one tables;
  • a column whose default is forced by a condition (default_when) is written with that value even when its cell was not edited;
  • then, row by row, the hooks: on_update, on_insert (or on_duplicate for a cloned or pasted row) and on_delete.

When a write or a hook fails, its message shows and bulk edit stays open. After a successful save, bulk edit closes and the grid reloads.