NightWing Enterprises - FileMaker Pro Custom Development

+
+   Home    About Us    Products    Demos    Resources    FAQs    Orders    Contact   +
+

V



NightWing Enterprises — Demo for FileMaker Pro™ 10


Duplicate a Record and All its Related Records!

Duplicate Hierarchic Sets

+   For FileMaker 10   +


As a courtesy to fellow developers and potential clients, the
following demonstration file is provided for free download.


Duplicating a record in FileMaker Pro is easy. But sometimes, you need to duplicate more than just the current record - you need to duplicate the related records as well. For example, if you have a customer who has sent in a complex order and later asks for the same order to be repeated, you need to duplicate the Order record and all the Order Item records. If there are more than two tables involved, the task of duplicating them manually or recreating them may be onerous.

This demo shows a method of creation in-place of an integral hierarchy of records - a parent record and all its child, grandchild and great-grandchild records. The demo uses the example of a student program and the subjects, units and options that form part of the program. Although this is a single branch of relationships, the technique can work equally well with multi-branching relationship structures and with cascading relationships of any depth. The process requires A) a utility TO (joined to a global field in the Parent for each related Table that is to be involved in the hierarchal duplication), and B) a global field containing a list of the fully specified names of all the fields that are to be duplicated in all tables forming part of the hierarchy. With these elements in place, the two scripts provided in the demo will efficiently duplicate the hierarchal record set in its entirety.

The scripting model for this approach makes central use of indirection, in particular the Set Field By Name[ ] script command, to complete the entire process with minimum code and to ensure that the scripts are portable. Moreover the method is fully transactional - the entire record set is created from the context of the parent record and is committed once at the conclusion of the process. In addition, the process is entirely portable - aside from two global field names (one in the parent table and one in a System table) all field names are retrieved and resolved dynamically, as is the hierarchic structure for the duplication process. The same two scripts can duplicate the data in any shape and size of hierarchy.

The central process employed for this technique is that of a data pivot that draws data from each related table in turn, and pushes it out (via an "Allow creation..." relationship to the utility TO of the same table) into a new record that is linked to the duplicated parent record. By this means, the process can be accomplished efficiently without requiring layouts for each of the tables and without committing any of the duplicated records during the process.

This demo file is unlocked and password-free, compliments of NightWing Enterprises. The use of this technique is free for private and educational purposes. Use for business or commercial applications is subject to license (pricing on request).

* This demo requires FileMaker Pro 10.



Mac OS X demo download  
MacOS
Win XP/Vista demo download  
Windows
 



Duplicate Hierarchy demo for FileMaker Pro



NB: Should you require assistance implementing procedures such as those shown in our
example files, please consider establishing an account with us for developer support.






^


NWE

NightWing Enterprises
ABN 22 207 533 285
www.nightwing.com.au/FileMaker
PO Box 20, Dallas, Victoria, Australia 3047
Ph +61 3 9016 3347  •   Fax +61 3 9309 8273  •   Mobile 0409 309 143
Email: admin@nightwingenterprises.com


+
+   Home    About Us    Products    Demos    Resources    FAQs    Orders    Contact   +
+


-----------------------------------
©2001 - 2011 NightWing Enterprises
Please report any problems with this site to:   webmaster@nightwing.com.au  

NightWing Enterprises - FileMaker Solutions:- NightWing Enterprises, and the internet code-named CobaltSky is an internationally recognized Filemaker consultant, Filemaker developer and provider of Filemaker Pro custom databases, Filemaker Pro custom development, Filemaker Pro custom programmer services and Filemaker Pro custom programming.
Site created and managed using FileMaker™ Pro.

NightWing Enterprises is a division of   d a r k s k y   m e d i a