Skip to content

Inserts, copies and deletions#

Besides changing values, a form adds new records, copies one that already exists and marks records for deletion. Like any change, inserts and deletions stay pending until you submit the changes.

Before you start#

  • Insert and Duplicate require the privilege to insert records in the table of the form.
  • Delete requires the privilege to delete records of the table. Discarding a new record you have not yet submitted does not require it.
  • Without those privileges, the buttons are disabled (see What each user can edit).

Add a record#

  1. On the toolbar of the form (or of the detail), click Insert. It is also in the record menu (right click on the status column).
  2. The new record appears first in the grid, marked with the plus sign, and is chosen.
  3. Type or choose its values, as in any record.
  4. Click Submit changes when you finish (with this record or with more changes).

Proposed values#

When inserting, some fields may come already filled in or with a text instead of a value:

What you see What it means
A value already typed The metadata administrator has given the field a next-value SQL: Empowerment Center calculates it when inserting. It is usually the next number of a sequence, your user code or your user name. You can change it if the field is editable.
“Automatic” The database generates the value when saving the record (an identity key). It is not typed: when the changes are submitted, the cell takes the value the database has given.
Nothing The field starts empty.

If the calculation of a value fails, the status line says so and the rest of the values are proposed anyway.

Note

A value proposed with a calculation such as “the highest code plus one” may match that of another user who is inserting at the same time. The second one to submit gets the problem “Violates an integrity rule” (duplicate key). Change the value and submit again.

What can be typed in a new record#

In a new record you can type the primary key and the fields whose dimension has an edit privilege for you. You do not need the privilege to modify records: the one to insert is enough. In a detail, the fields that join it with the master are set by ECenter (next section).

Add detail records#

A new record in a detail form hangs from the record chosen in the master. For example, a new line hangs from the chosen invoice.

  1. Choose the master record.
  2. In the tab of the detail, click Insert on its toolbar.
  3. Fill in the detail record. You do not need to type the columns that join it with the master: ECenter sets them with the values of the master.

You can add a master record and its details in the same submission: insert the master, without submitting choose that new record, insert its details and submit everything together. It also works when the key of the master is generated by the database (“Automatic”): ECenter saves the master first, takes the key the database gives it and puts it in its details, all in the same submission. If something fails, neither the master nor its details are saved.

If the new master does not yet have the values that join it with its details and nobody is going to set them (neither you nor the database), ECenter submits nothing and says so: “A new record of "…" depends on a record of "…" with no value in …: complete the master record first”.

The “Presupuestos” form with a new quote whose key says “Automatic” and two new lines in its detailThe “Presupuestos” form with a new quote whose key says “Automatic” and two new lines in its detail
The “Presupuestos” form with a new quote whose key says “Automatic” and two new lines in its detail

Duplicate a record#

Duplicate creates a new record with the values of the chosen record, so you do not type again what repeats.

  1. Choose the record you want to copy.
  2. Click Duplicate.
  3. Change what is different and submit the changes.

The copy does not carry:

  • the primary key, because it would be repeated and the submission would fail;
  • the columns that join it with the master, which ECenter sets;
  • the fields you cannot add or those the database generates;
  • the fields that the next-value SQL has already filled in: those keep the proposed value.

Delete a record#

  1. Choose the record.
  2. Click Delete (or Delete… in the record menu).
  3. Confirm in “Delete the record?” with Delete record.

The record is marked with the trash can and struck through. It will be deleted from the database when the changes are submitted. Until then, Undo recovers it.

A new record you have not yet submitted disappears right away, without asking: there is nothing to delete in the database.

Warning

Deleting a master record also deletes its detail records in all the detail forms of the form, including the nested ones, when the changes are submitted. If you have details loaded, the confirmation says so (“Its associated records of Facturas will also be deleted.”). All the detail records you see are deleted, not only those of the segmentation. If there are detail records you cannot see and the database prevents it, the submission fails with “Violates an integrity rule”.

Undo#

Undo returns the chosen record to how it was read: it removes its changes, recovers a record marked for deletion or discards a new record. It acts on one record at a time.

To undo everything at once, choose ⋯ › Discard changes… in the document header. ECenter asks “Discard the changes (n)?” and, when you confirm with Discard changes, reads the form again as it is in the database.

See also#