- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 12:35 PM
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.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 02:24 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 07:11 AM