Is it feasible to create a “universal join” object?

In a blog addressing the implementation of Milestones PM into an existing Org, Reid Carlberg suggests the creation of a “universal join object.” In essence, this object effectively facilitates type agnostic M-to-M joins similar to the Related To field on Activities.

Although malleable, I was wondering if this is an effective approach given the following:

  • Need to rely on multiple formula fields to pass information through to related lists
    • It was my understanding that this work-around is very inefficient
  • Complexities introduced in writing SOQL queries
  • Difficulty it introduces in aggregating information via reports
    • Even greater reliance on formula fields is required to make reporting possible

The above is as I understand it. If my assumptions are incorrect, I would appreciate it if you could please advise.


I have implemented something similar, and although your concerns are very valid, it can be a good solution in the right use case. But I think it only make sense when it is primarily the relationship that you care about – I wanted to know all x linked to y – and the fields you want to display on any related list/report are mostly just fields from the join object about the relationship, along with maybe the standard Name field.

In my case, we wanted to link an ‘Issues’ object with various related items like Projects, Grants, Contacts etc. Having one join between them all enabled us to then report on all items linked to an issue, grouped by type using Standard Reports.

The trick to making that work for us was to have some workflows that always set core fields on the join object for ‘Object Name’, and ‘Object Id’ along with an actual lookup field to the target object record. In that way, if I wanted Projects linked to an issue, I could use those fields to easily query for just records that were linked to Projects by using the Object Name Field, and would then have a list of Ids I could use for a second query/update etc.
That also made formulas a bit more practical because I could write a Case formula based on the Object Name, and then link to different target lookups via a cross object formula depending on which type of record the join record was linked to.

For the most part, we created custom vf pages to do the association so that we could more easily bring in related fields to view/query by on related objects – because we knew what each object was in that instance, we could query each object directly.

You can see the code here.

Source : Link , Question Author : toolshed , Answer Author : BritishBoyinDC

Leave a Comment