Understanding Relationships between Records
In Lanetix, Relationships can be built between the different Record Templates (Types). For example, you may have multiple Opportunities that link back to a single Account, or Accounts that link out to multiple Contacts.
Lanetix flexibility allows you to create these relationships between records and them view them in multiple ways. For example, Contacts to Accounts, Opportunities to Accounts, Campaigns to Opportunities, Trade Lanes to an Opportunity, Contracts to a Trade Lane, etc. These relationships can be set up in Lanetix as either Related Records or Child Records.
Planning Your Data Model
First, understand the relationships relevant to your organization and how the different Records fit together. What do the relationships look like? One to one, many to one? Your Lanetix solution architect or account manager can help you draw up a relationship graph similar to the one below to help plan out your data model.
Other questions you’ll want to understand before proceeding are:
- Does one item exist without the other?
- Are there separate workflows for the different Records?
- How do you want to view one in relation to another?
These questions will help you determine if you wish to create Records that stand alone, Records that relate to other Records OR Child Records that live on a single Parent Record.
Do You Need Related Records or Child Records?
Related Records are appropriate when the objects in question can stand alone and you would want to view them as separate entities or be able to detach and reattach them elsewhere. For example, a Contact may leave an Account, but that Contact still exists for networking purposes. They may also move to another Account to which you want to link them.
Related Records are also appropriate when the different objects may move through their own separate workflows or you wish to trigger another event via this object. For example, an Account may have an Onboarding workflow, while each Opportunity under that account has a Bid workflow, very separate from the onboarding. In this case, you would want full Record Templates on which you can create these individual workflows. Also important, a Record can only travel through a workflow one time, so the Accounts’ Bids would each need to be separate allowing for this action. You are also able to trigger processes from a related object--such as a trigger email, automated workflow launch or the creation of another record.
However, in instances in which the related record doesn’t exist without the original record and doesn’t require workflows or triggered events, a child record may be a more appropriate relationship. For example, your contacts may have multiple phone numbers. Instead of creating fields for every possible phone number, you can create a child record that captures these specifically to the Contact in question. And obviously, if the Contact were to be removed from the system, the phone numbers would be removed as well.
Trade Lanes on a Bid is another example of a type of relationship in which having a Child Record type is appropriate, since the Trade Lanes are specific to a Bid and don’t have additional workflows or existence outside of that Bid.
One benefit to using child records is inline editing of child record tables.
Summary of Related Record vs Child Record Characteristics
|Each item is its own entity.||One item does not exist without the other.|
|Each item moves through separate workflows.||There are no workflows associated with the child record.|
|Each item can trigger an event, such as an email, automatic workflow launch or another record’s creation.||Other events cannot be triggered based on a child record.|
|The Record has its own page on which to detail information.||The Record exists only in a table on the Parent Record.|
|Edits must be made from individual Record page.||Edits can be made inline on the table view from the Parent’s Page.|
|Moves Through a Workflow||Yes||No|
|Triggers a Notification Email||Yes||No|
|Triggers a Workflow||Yes||No|
|Triggers another Record’s Creation||Yes||No|
|Maintained on its own Record Page||Yes||No|
|Allows for Inline Editing||No||Yes|
Please see this article for information on Creating Child Records.
Creating Related Records
If you’ve read the above and wish to create separate but Related Records and you’ve planned the relationships between those Records, you can create the links in the Creation Studio when Editing Record Fields. A special field type called “Picker” is used to create the relationship. Only one Picker is needed, on the “many” record template in the relationship.
We will create a new field that links the two Record Templates. To do this, click the New Field button.
In the New Field Panel, name Record Template that you wish to link. In this case, we are linking the Account. In API Name for a picker field, it is best practice to add “_id” to any linked Record Templates. This will help in cases in which you need to upload data and you need to know which fields require a lanetix id number as opposed to plain text. (Otherwise, the links will be lost upon upload. Trust us. We’ve done this a few times.)
Under Type, choose Picker. This will designate to the system that you’ll be picking another Record Type in this field.
Lastly, click Constraints and a listing of all current Record Templates in the system will appear. Choose the appropriate Record Template that you wish to link. In this case, we will choose Account.
Finally, if you have a default value that you wish to set, choose that now. The field will show a listing of all possible options already in that field type. A possible use case for this is if you have Currency as a record type, and you wish for the default to be USD, but still have the option to choose other currencies.
In this case, we will leave it blank since the Account will always need to be updated. Click Save.
Displaying Related Records on a Record Layout
One to One Relationship (single link)
To view the Account information on the Contact page, you will simply need to add the new “Account” picker field (account_id) via the Contact’s Record Layout. This is done the same as adding any other field. Instructions on this can be found here.
One to Many Relationship (table)
There will likely be many contacts associated with a single account. To view the Contact information on the Account page, you will go to the Account Record Template, and create a table on the Record Layout. This is the “many” side of the relationship. You do not need to create another Picker field on the “many” record template.
From Record Builder, choose the Account Record Template (or which ever record is your One in your One to Many relationship).
From the Record Template edit screen, choose Edit on the Record Layout tile.
Choose the Page and Group to which you want to add your Many records. In this case, we have a page called “Contacts” and a Group already called Key Contacts. Click Edit within the Group tile.
In the Layout creation screen, click the Table button.
Choose the Record Template type that you wish to link. In this case, we’re linking the Account (Contacts).
You will be presented with all fields available to view from that Record Template. Choose the fields that you wish to be viewed on the Account page. In this case, we’ll choose Name, Decision Making Power, Email, Created At and Phone Number. Once chosen, click Create.
You can re-title the table name in the Custom Label box, and then adjust your fields to the order you wish to see them. Click “Add Fields” to insert more columns. By hovering over the column, you will also see options to rename the column or remove columns.
Once complete, return to the Page Overview and click Publish.
From the Account Record Instance and the Contacts page, you will now see a table listing the contacts on the account.
Note you can only see three lines in this view. Click Expand and Edit to view all.
From this page, you can also add new rows (in this case contacts). And any newly added contacts linked to the account will appear in this table.
This type of viewing can be used for Opportunities on an Account, Contracts on an Account, etc.
View a Record Template’s Existing Relationships
While in a Record Type, such as Account, you can click into the settings menu to view all Record Templates associated with the current one.
Choose the first option “View Relationships.”
A listing of all Related Records, to and from, the current record will be listed.
View a Graph of All Record Relationships
After creating the linking fields on all appropriate Records, you will be able to see a map showing these relationship from the Creation Studio and in the Record Builder tile.
Select the graph icon to open a visual representation of your Record Template relationships. You can choose various options for display of these associated Record Templates, giving you a picture of how your data fits together. Try clicking on a node in the graph to change the focus. Export this graph for use in other tools.