function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BenBeaumontBenBeaumont 

I keep bumping into denormalisation

While developing our sales force, I keep coming across the need to denormalise data to show in list. I think this is only because we have many-to-many relationships between objects within out data structure. The relationship therefore has to be represented by a third object, a _has_ table. E.g. we have two objects A and B that have a m-2-m relationship, so we implement an A_has_B object that simply contians a unique key, the id of an A object and an id of a B object.

However, for example when showing the list of B items in A, I would also like to show other data from the B object in the list, especially if I am using an auto-number id for the B object.

The only way I can think to do this is to write in code to denormalise the data from the B object to the A_has_B object. Of course this is horrible and I can't think of a simple way of ensuring that data is kept up to date.

Any suggestions?