Commit ff4bf247 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3900 / 'Copy Form' Documentation

parent 2598a1ba
......@@ -2943,7 +2943,7 @@ the following (switch off all non named):
Copy Form
^^^^^^^^^
Records (=master) and child records can be duplicated (=copy) by a regular `Form`, extended by `FormElemens` of type 'paste'.
Records (=master) and child records can be duplicated (=copied) by a regular `Form`, extended by `FormElemens` of type 'paste'.
A 'copy form' works either in:
* 'copy and paste now' mode: the 'select' and 'paste' `Form` is merged in one form, only one master record is possible,
......@@ -2954,16 +2954,16 @@ Concept
A 'select action' (e.g. a `Form` or a button click) creates record(s) in the table `Clipboard`. Each clipboard record contains:
* master record id(s) of the record(s) to duplicate,
* the 'id(s)' of the record(s) to duplicate,
* the 'paste' form id (that `Form` defines, to which table the master records belongs to, as well as rules of how to
duplicate any slave records)
* user identifier (QFQ cookie) to separate clipboard records of different users.
duplicate any slave records) and where to copy the new records
* user identifier (QFQ cookie) to separate clipboard records of different users inside the Clipboard table.
The 'select action' is responsible to delete old clipboard records of the current user, before new clipboard records are
The 'select action' is also responsible to delete old clipboard records of the current user, before new clipboard records are
created.
The 'paste form' iterates over all master record id(s) in the `Clipboard` table. For each master record id, all FormElements
of type `paste` a fired (incl. the creating slave records).
of type `paste` are fired (incl. the creating of slave records).
E.g. if there is a basket with different items and you want to duplicate the whole basket including new items, create a
form with the following parameter
......@@ -3023,6 +3023,22 @@ form with the following parameter
* sql1: `{{!SELECT i.id AS id, {{basketId:P}} AS basketId FROM Item AS i WHERE i.basketId={{id:P}} }}`
* Parameter: `recordDestinationTable=Item`
Table self referencing records
''''''''''''''''''''''''''''''
Records might contain references to other recrods in the same table. E.g. native FormElements might assigned to a fieldSet,
templateGroup or pill, a fieldSet might assigned to other fieldsets or pills and so on. When duplicating a `Form` and the
corresponding `FormElements` all internal references needs to be updated as well.
On each FormElement.type=`paste` record, the column to be updated is defined via:
* parameter: translateIdColumn = <columnname>
For the 'copyForm' this would be 'feIdContainer'.
The update of the records is started after all records have been copied (of the specific FormElement.type=`paste` record).
.. _delete-record:
Delete Record
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment