Skip to main content

Hi everyone,



Is there anyway to make one-to-many relationship kind of master-slave relationship?


What I mean by master-slave here is making one table master and the other slave so if someone deletes a record in the master table, related records in the slave table would be automatically deleted. Is this kind of things are possible?



Thanks!

Not entirely possible natively, but you could simulate this in couple of ways…



You could use the scripting block to allow users to delete a record from the eMaster] table, and then with the same script, delete the associated record(s) from the eSlave] table in the background.



For a more simple approach… If you have linking relationships set up, i.e. Record A on the tMaster] table is linked to Record A on the tSlave] table, you could set up a view on the tSlave] table that is filtered to only show records that have a value linked to the tMaster] table. This way when a record is deleted from rMaster], the associated records would fall off of the view on the tSlave] table. You could then set up a second view that is filtered to only show records without a value linked to Master], and delete them -manually- periodically.



Hope this is helpful!


Reply