3 Replies Latest reply on Jan 22, 2014 9:21 AM by user14040

    Delete Problem - Deletes entire database Instead Of One Record

    user14040

      Title

      Delete Problem - Deletes entire database Instead Of One Record

      Post

           Hi

           I ran into a problem when deleting records.  When I create a button to delete one record it tries to delete the entire database.

            

           I even tried to use the delete record button on the FM menu bar and it says the same thing. 

           Any ideals on hope to delete just one record

           Thanks

           Larry

      delete_error.png

        • 1. Re: Delete Problem - Deletes entire database Instead Of One Record
          philmodjunk

               I am assuming that when you say it want's to "delete the entire database" it deletes all the records in one or more tables in your file. The dialog you show is the normal confirmation dialog for deleting a single record from the Layout's underlying table.

               Check Manage|Database|Relationships for cascading deletes. Double click relationship lines and look for check boxes where the "delete related records in this table when a record is deleted in the other table." has been selected. Be especially careful to check for this in any self join relationships or relationships where the X operator is used. And this can be a "chain" or deletes where deleting a record in table 1 deletes a group in table 2 that then deletes a group  in table 3... And this might even loop back to a different occurrence of table 1. And with Tutorial: What are Table Occurrences?, such an option need only be selected in a single relationship to a single occurrence of that table for a record delete in any layout that refers to any occurrence of the related table to trigger the cascade.

               I've started adding Note Box in Manage | Database | Relationships in my new projects where I list each relationship that has "delete" enabled at the time that I select that option just as a better way to keep track of them.

          • 2. Re: Delete Problem - Deletes entire database Instead Of One Record
            FilmUser

                 The message is asking if you want to delete the "Entire Record", not the entire data base, or All of the Records.

                 This is the message you would get using the file pull down menu bar command, just confirming that you know what you're doing.

                 I agree, it sounds extreme - plus - how would you delete "part" of a record?

                 I've always wondered why it doesn't say, "Are you sure you want to delete this record?"

            • 3. Re: Delete Problem - Deletes entire database Instead Of One Record
              user14040

                   Thanks 

                    

                   The problem was in the relationship, I  checked delete records in related records by mistake.

                    

                   Thanks For your help