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
NielsMNielsM 

How can you relate different child objects to a master object?

I have contract documents which are reviewed and summarised by using different types of forms. Contract 1 may be summarised using an employment form, contract 2 may be summarised using a tax form, contract 3 may be summarised by a real estate form and so on.
 
Using custom objects I have created each type of form - the forms pose different questions to capture specific details in the contracts. What I'm now trying to do is create a custom "document summary" object that relates a document instance to the review forms. The entity-relationships are as follows
 
  • a document can have 0 - many document summaries
  • a document summary can be one of employment form, tax form, real estate form etc.

Can I use the Lookup Relationship field type to do this? If so, do I need abstract the form type in some way?

cbrowncbrown
My suggestion would be have three record types for Contract. one for: employment contract, tax contract, real estate contract.

Then use a pagelayout for each record type, only showing a related list for the appropriate form.

You can either create three custom objects with a master-detail lookup to contract and control the right related list being shown per contract record type and a page layout for each.

Or alternatively use record types to control the type of form fields on your singular Form custom object, using only one custom object to represent all forms, just using record types and page layouts to adjust which fields are relevant for each type of form.

From the contract, you could create custom buttons to create "New" instances of this single form of the appropriate record type, essentially having three custom buttons with a Label "New" each creating a form of different record types, and appearing on the appropriate Contract Record Type page layout. Perhaps this New button could be dynamic in execution, encapsulating the logic for which form record type, based on the current contract record type you a on when its clicked.

The benifit of this record type approach would be in reporting as you may wish to report againts all contracts with forms, grouped by type etc.