12 Replies Latest reply on Oct 8, 2013 7:36 AM by davehob

    Error 407 when trying to delete a record

    davehob

      When trying to delete a record, I'm getting an error 407, "One or both match fields are missing (invalid relationship)". It seems this is something to do with cascading deletes, i.e. that there are no child records to delete. But given that related records in this situation are not required to exist, I'm in a catch 22.

       

      Any ideas how to get out of this?

       

      Dave.

        • 1. Re: Error 407 when trying to delete a record
          LyndsayHowarth

          Create a new layout with the base table concerned and see if you can delete the record from there.

           

          - Lyndsay

          • 2. Re: Error 407 when trying to delete a record
            taylorsharpe

            Have you gone to the child tables and tried to delete any related records?  Are you positive there are no related records?  I still suspect that is the problem.  If it still won't delete from the base table, then you might try to recover the database in case there is some corruption. 

            • 3. Re: Error 407 when trying to delete a record
              davehob

              Hi Lyndsay - thanks for the suggestion, but that doesn't work either.

               

              Dave.

              • 4. Re: Error 407 when trying to delete a record
                davehob

                Taylor,

                 

                Thanks, but I've double-checked, and there really are no related recs.  I've also created a new (parent) rec, then gone to each of the child tables to check that nothing's getting created automatically, and it isn't. 

                 

                I'll try the recoovery and will report back - rather anxious at the thought of a corruption...

                 

                Dave.

                • 5. Re: Error 407 when trying to delete a record
                  ch0c0halic

                  If any of the fields do not have an index they would make an 'invalid relationship'.

                   

                  Are any of the fields used in the relationship set to Global storage or set to not be stored?

                  • 6. Re: Error 407 when trying to delete a record
                    davehob

                    No, no globals, nor indexing set to "none" on any key fields.  (The only global fields around are those used in selector/match type relationships, and none on foreign key fields.)

                     

                    Recovery seems not to have helped either.

                     

                    Given that I'm in the process of re-writing this application, I'm tempted to decide that I've spent enough of my time (and others') on this, and that the users will just have to live with not being able to delete records.  But I'm rather anxious that this is a symptom of a bigger problem that may bite me later on.

                     

                    Thanks for the help.

                     

                    Dave.

                    • 7. Re: Error 407 when trying to delete a record
                      timwhisenant

                      Hi Dave,

                       

                      Is this a parent record? Or a record in a portal?

                      If parent record on what TO is the layout based?

                      Lyndsay's suggestion should work unless the account you are logged into is denied delete privileges to this table.

                      A little more detail on these may help diagnose your issue.

                       

                      Tim

                      • 8. Re: Error 407 when trying to delete a record
                        davehob

                        Tim,

                         

                        Thanks for giving this some thought.

                         

                        It's a parent record, but with no children, and no portal involved.  It's the main "People" table in a file involving family relationships (so literally parents and children!), enrolments onto programmes, roles and tags (all through join tables), etc., so there are a number of potentially related records, but I'm confident that I've got rid of any related child recs.  I've attempted to delete it on a variety of layouts based on the base table.  I'm doing this as a [Full access] user, so I don't think it's a privilege issue.  Still no joy.

                         

                        Dave. 

                        • 9. Re: Error 407 when trying to delete a record
                          taylorsharpe

                          What if you delete all relationships to this table and then try to delete the record and then reestablish the relationships?

                          1 of 1 people found this helpful
                          • 10. Re: Error 407 when trying to delete a record
                            davehob

                            Now we're getting somewhere!  On a backup copy of the file, I did what you suggested, i.e. deleted all the relationships from the source table. (I use the anchor-buoy structure, so I just deleted the many "squid legs" coming from People.  And I could (finally) delete the offending test record and, it seems, any other.

                             

                            So I guess this proves that one (or more) of those relationships is to blame.  Rather than re-instate all the relationships (which would take ages), I think I'll restore the file and systematically go through each relationship in turn (delete relationship, then test rec deletion, then restore relationship) until I find the culprit, then work out in what respect it's invalid. 

                             

                            Thanks again for all the help.

                             

                            Dave.

                            • 11. Re: Error 407 when trying to delete a record
                              timwhisenant

                              Hi Dave,

                              Glad for your test success. What this proves is that an anchor with cascading delete to children cannot be deleted if no children exist to validate the relationship.

                              Use a self-relationship to jump to an isolated TO with no relationships and delete from that TO.

                               

                              HTH,

                              Tim

                              • 12. Re: Error 407 when trying to delete a record
                                davehob

                                Well, I got there.  It turned out that, despite the relative orderliness of the relationship graph, there was an obsolete relationship that I had overlooked.  On the People side of the relationship, there was once a global match field, which had been deleted.  But I had failed to update the relationship, rendering it invalid.  The absence of child records was therefore irrelevant.

                                 

                                Thanks for all your inputs - I'm feeling somewhat stupid, but at least I've learned from this.

                                 

                                Dave.