From Dwayne Wright PMP
Certified FileMaker Developer
Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here).
In this example, I setup to self relationships in which one of the relationships shows all the records in the table. I do this simply so you can see a portal from the main example layout and see the original and duplicate entries.
The second relationship is defined by what I consider a duplicate and in this case it is the name of a song. A more classic example of a field that you might be checking on duplicates could be name, email address, zipcode, product name, etc...
Then I add a field that identifies the record if it is a duplicate or an original. Here I am looking to see (via the self relationship) if I have more than one matching record in the file. If I do, the one with the lowest primary key value is the original and the other is a duplicate.
Record_ID = TableA 2::Record_ID, "Original", "Duplicate")
The idea is that if the current record ID matches the related one, we are the first record with that song name. This is because we did not sort our relationship, so our TableA 2::Record_ID is always going to show us the first record created.
An example file can be downloaded by clicking here.
More info about the author and FileMaker in general, contact me at firstname.lastname@example.org.
© 2010- Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.