One often needs the same (or similar) TOs in multiple files, however currently only relationship names can be copied + pasted in the relationship graph, so 95% of the work must be undertaken manually.
It should be possible to copy and paste all object types in the relationship graph:
- table occurrences
- text notes
- Relationships may be copied WITHOUT copying the TOs they are connected to,
- However the details of the not-copied TO (i.e. Name, ExtFileRef,BaseTable & Field) should accompany the relationship data on the clipboard, as this plays an important role when pasting the objects back in to a database.
- Let us call the not-copied TOs "TO-Place holders", and
- the ends of the relationships which were attached to not-copied TOs "loose ends"
When pasting these objects into a database:
- The currently selected TO(s) should be allocated to TO-Placeholders and used to attach loose ends ( = magic ! )
- As usual when pasting objects into FileMaker
- External file references should be automatically created, as occurs when pasting other objects
- Where necessary references to base tables and fields should be matched by name
- Any loose ends should be bound to the currently selected TO(s) using the following logic:
- If no TO is selected all relationships with loose ends are NOT inserted into the relationship graph.
- Otherwise TO-placeholders are allocated to the selected TOs in the destination graph and the loose ends of the relationship are bound to these. (i.e. there is a 1:1 relationship between source-TOs and destination TOs)
- Thus if a single TO is selected the loose ends are bound to this (GIVEN THAT all the loose ends belonged to a single (NOT copied) TO in the source file).
- If there are multiple selected TOs and TO-Placeholders, the following logic can be used:
- If there is a different number of selected TOs and TO-Placeholders FileMaker matches what it can, and any remaining loose ends are NOT inserted.
- TOs whose names match are allocated
- If no names match the "N-ary" of the relationship is used to match+allocate (i.e. 1:N relationship is matched to 1:N)
- TOs whose base table names match are allocated
- If no match is found then the TOs are matched in the order they were selected.
Using this logic you could, for example, transfer a group of TOs along with their relationships from one file to another, or even within the same file hanging the related tables underneath another one:
(OK, OK, OK - the pasted TOs should have a " 2" suffix, as the TOs already exist, but you get the idea...)
THAT SHOULD DO IT NICELY!
- all of them
This is just one of the ideas to Make Copy + Paste just work
Please vote me up! You know you want it!