1 Reply Latest reply on Oct 20, 2008 3:32 AM by Orlando

    Basic Relationships



      Basic Relationships


        Why doesn't "Allow creation of records in this table via this relationship." work (in the Manage Data Base Relationships)  between tables related by a key index ?

        When I create a new record in a master table, a child table (that has also the key index) does
      not create a new record.  The master table uses "indexed, auto-increment, unique" settings for
      the key index.  I have tried different settings for the key index in the child tables and nothing
      seems to work.  Do I have to write a script program to create the new records ?  I have six child tables that need to have new records created whenever I create a new record in the master table.  It would be nice to have new records in the child tables automatically created.

         I used Filemaker Pro 6 years ago and just got back into using Filemaker Pro again.  I have ver.

      9 and 9 Advanced.



        • 1. Re: Basic Relationships


          Hi CountryBoy1


          The setting "Allow creation of record in this table via relationship" means that if you have that relationship displayed using on a layout, via a portal, you have the ability to type atraight into the last portal row and automatically create a related record. It does not create a record when the parent record is created unfortunately.


          The only way around this, if all 6 records must be created at the start, is to script the creation process of the parent and 6 chile records, and have a 'New Record' button the user must press to create the record, or you could assign the script to the New Record shortcut.


          The script would go something like this, assuming all tables are in the same file:


          Go To Layout [Parent]
          Create Record/Request
          Commit Record
          Set Variable [ $ParentID ; Parent::_UniqueID ]
          # Create the child records
          Go To Layout [Child1]
          Create Record/Request
          Commit Record
          Set Field [ Child1::_ParentID ; $ParentID ]
          Go To Layout [Child2]
          Create Record/Request
          Commit Record
          Set Field [ Child2::_ParentID ; $ParentID ]
          ... And so on until 6
          Go To Layout [Parent]
          # END 


          This will create your 6 child records all related to the Parent.


          I hope this helps.