With active copyOnDuplicate and the absence of a calculated value or active codeOnlyInAdd or a set manual value — the value from the duplicated row.
If there is no default or code — the value from the duplicated row.
If the field type is Unique and it was overridden — the new value is written.
In all other cases, the value is recalculated based on the data of the new row.
When duplicating a cycle, the values in the fields of all its tables are fully duplicated.
Table versions in the duplicated copy remain the same as in the duplicated cycle.
Action codes for addition do not trigger.
If there is code on duplication, it is executed fully instead of the standard duplication mechanism.
When executing the code, the variable $#ids
will be available, containing the list of id
of the duplicated rows (marked with a checkmark).
Only for CODE when adding a duplicated row!
ex: $#duplicatedId
Returns the id
of the row from which the duplication was made.
If the addition does not occur through duplication, it returns 0
.