m2m Relationship - populate variable on 'child' record

alexcharleswort
Tera Expert

Hi!

I have set up a m2m relationship with two tables and it works like its supposed to, but I would like to populate a variable based on which record the 'child' has been attached to. For example, lets say I have a table called u_colors and my second table is called u_shirts. On my u_color table I have record 'Red', 'Orange', 'Blue', 'Pink' and 'Black'. On my u_shirts table I have record 'TShirt', 'Polo', 'VNeck'. I want to work off of my shirt table and assign available colors to each type of shirt.

For TShirt I have added Red and Blue

For Polo I have added Red, Pink and Orange

For VNeck I have added Pink and Black

What I want to have happen is whenever a color is added to the TShirt record, I want 'u_tshirt_option' (which is a Boolean on each of the u_color records) to be marked as true. I want the same for every color that is added to the Polo record on instead I want it to mark "u_polo_option" as true on the Red, Pink and Orange Records.

In the end, Red would have u_polo_option and u_tshirt_option marked as true, Pink would have u_polo_option and u_vneck_option marked as true, and Black would have just u_vneck_option marked as true.

Hopefully this makes sense.

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

michael_baker
Tera Guru

Hi Alex,



I would suggest you create an after Business Rule on the newly created many to many table that updates the associated u_color record on insert/update/delete.



Hope this helps!


View solution in original post

5 REPLIES 5

This also does not work...


find_real_file.png