Help

Mater-slave type of one-to-many relationship

Solved
Jump to Solution
1312 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Hisa_Kizu
5 - Automation Enthusiast
5 - Automation Enthusiast

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!

1 Solution

Accepted Solutions
AlliAlosa
10 - Mercury
10 - Mercury

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 [Master] table, and then with the same script, delete the associated record(s) from the [Slave] table in the background.

For a more simple approach… If you have linking relationships set up, i.e. Record A on the [Master] table is linked to Record A on the [Slave] table, you could set up a view on the [Slave] table that is filtered to only show records that have a value linked to the [Master] table. This way when a record is deleted from [Master], the associated records would fall off of the view on the [Slave] 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!

See Solution in Thread

1 Reply 1
AlliAlosa
10 - Mercury
10 - Mercury

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 [Master] table, and then with the same script, delete the associated record(s) from the [Slave] table in the background.

For a more simple approach… If you have linking relationships set up, i.e. Record A on the [Master] table is linked to Record A on the [Slave] table, you could set up a view on the [Slave] table that is filtered to only show records that have a value linked to the [Master] table. This way when a record is deleted from [Master], the associated records would fall off of the view on the [Slave] 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!