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
Sherrie MillerSherrie Miller 

M2M across multiple objects

Hello. I feel like there is a basic answer to my question that I simply am not using the right terms to search for to find the answer. 

Our CONTRACT object has a contract type picklist (Principal Agreement, Amendment, etc). On the CONTRACT I have a field for Principal Agreement so I am able to track all Amendments and other child contracts tied to the principal contract. 

We have a custom objection LOCATION.

From a non-SF perspective:
A LOCATION may have many CONTRACTS across many ACCOUNTS and a CONTRACT may be related to multiple LOCATIONS. 

I had planned to create a CUSTOMER-LOCATION junction object, but am a bit stuck because a CUSTOMER-LOCATION may have many CONTRACTS associated with it: a principal contract and then be impacted by later amendments. These amendments will change the details of this CUSTOMER-LOCATION profile (think fields like headcount, equipment count) so they all need to be able to be associated with it. 

I can create a CUSTOMER-LOCATION object that captures the info, but can only relate to one CONTRACT or I can create a CONTRACT-LOCATION object but then I have duplicates of these for the same Customer because each CONTRACT iteration will have its own. 

I have tried every way I can think of but am limited by the number of Master-Child relationships per object. I believe I must be missing the obvious here and would appreciate any shared insight. 

At the end of the day I want to view
  • All associated LOCATIONS on each CONTRACT
  • All ACCOUNTS related to a specific LOCATION
  • All CONTRACTS for a LOCATION
  • All LOCATIONS for an ACCOUNT 
  • By default I have all CONTRACTS for each ACCOUNT
Thanks in advance. 
GreyGorilla VaporGreyGorilla Vapor
I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.

Caliburn G