1 Reply Latest reply on May 9, 2013 12:56 PM by philmodjunk

    Whether to allow deletion of related records or not



      Whether to allow deletion of related records or not


           I set up a transactions table. I have a goods inwards layout where I add new stock. I don't allow the deletion of related records in my inventory table because I'm afraid if more copies of a previously entered sku need to be added and I subsequently need to delete an entry in the goods inwards table I'll end up deleting an entire item in my inventory.

           But most of the time I need to delete both the entry in goods inwards and in the inventory. It is quite cumbersome to delte it in goods inwards and then go to the inventory layout and then delete the item too. 

           I could add a button that deletes the record in goods inwards and the related record in inventory. Is this the best solution? Or should I just go ahead and allow deletion of related records in inventory?

        • 1. Re: Whether to allow deletion of related records or not

               cascading deletes are powerful tools and like most powerful tools, they are also dangerous if misused. I wouldn't enable automatic deletion if there are ever cases where deleting the parent record should take place without deleting all related child records.

               A scripted option that deletes both would seem to be a safer idea given your scenario.

               You may also want to set up a report that lists all child records without a matching parent record so that you can monitor how well your system is managing data integrity.