Add Multiple Child Records at one time to a join table and have the records linked to both parent tables
Is there a way to add multiple child records from a parent table to a join table at one time and have them linked to both parents?
I want the records created in the join to be linked to both parent tables, but I don't want to have to have individuals edit each individual record created and manually link to the other parent.
Please note the following:
- The number of child records being added would not be static and would vary from entry to entry.
- Tags have relationships elsewhere in my build so it is not as simple creating the relationship of Batches have many Tags.
The way I currently have it set up is there are two Parent Tables (Batches and Tags). These two tables are connected by a join table.
The Tag table is pre-loaded with tags that each have a unique Tag ID, so the tags already exist. The tag IDs are sequential and unique.
The action starts after a Batch in the Batch Table has been created, however it doesn't trigger immediately after creation. The action would trigger when the Batch record is updated and a certain field is populated, but I'm trying to determine what (if any) field could do this.
I have two ideas but I cant find any solutions on how to make them work/if this is even possible.
My ideal solution would be to have 2 fields in the batches table [Starting Tag #] and [Ending Tag #]. These 2 fields would trigger an action that would search the records in the Tags Table to find the [Starting Tag #], [Ending Tag #], and all of the tags between them. The number of tags would be the number of records created in the join table. The records in the join would have lookups to the Related Batch and The Related Tags.
The only other idea I have is to have a [# of tags] field in the Batch Table and the number entered in this field would create that many records in the join table. However, this would not solve the issue of having to manually attach Related Tags to each record.
Hope this makes sense. It makes sense in my head but is much more difficult to but into writing.
------------------------------
Matt S
------------------------------