3 Replies Latest reply on Jan 25, 2009 6:01 PM by miw

    Updating relational fields



      Updating relational fields


      I have two tables linked by a common field named "Place".  Table 1 defines the "place" name and the Table 2 "place" field is selected from a pulldown menu based on the place names in Table 1.  If I edit a "place" name record in Table 1, how can I automatically get the previous linked records in Table 2 to update with the same edits to keep the link intact?

        • 1. Re: Updating relational fields

          Hi MIW


          The primary key can't be edit, otherwise you'll lose every related record.


          So that normally the primary key is an auto-entered serial number, not modifiable, that FileMaker creates for you on creation of new records.


          Table 1 and Table 2 must be related by that key.


          If so, than you can edit your 'place' name.

          • 2. Re: Updating relational fields

            A few posts ago someone pointed out a way to handle this kind of thing, by having a script called 'Edit Place Name'.  The user had to click on the button, was offered a dialogue for the 'old' name', asked to enter the 'new' name, and then the script went off and found and renamed every instance of every 'old' spelling in all the appropriate tables.  But I think it was offered in the spirit of "Dumping sawdust in the sump will cure a rattle in your engine." - it would work but is just not the kind of thing you want to be inflicting upon your database.


            I would take raybaudi's advice and avoid having primary keys which are likely to be modified.



            • 3. Re: Updating relational fields
                 Thanks for the suggestion - it will make my datafile much more secure and less prone to errors.  I did what you said and it works great.