Return to Entity Customizations. Within customized entity form you can see relationships options.
What are they?
These options determine the relationships between the selected entity you customize now and other entities which you want to set relations with.
There are 3 types of relationships:
1:N relationships (one to many)
N:1 relationships (many to one)
N:N relationships (many to many)
Let’s see the difference.
1:N relationships.
Using this type of relationship you select related entity. The related entity records are reflected in the selected display area in primary entity record.

In this case you can select multiple related records. In my example I will create the 1:N between Contact and Custom entity, created before.
See how it will look in practice.

N:1 relationships
Opposite to 1:N is N:1 relationship. Here you should set the primary entity. Also put Display Name you want to see within entity record and set other options.
This kind of relationship is presented in the lookup window form. After it was created go to Form and Views -> Form and set this lookup field within record form. Do not forget to publish changes.
See how it will look in practice.

As you can understand these types of relationship are two sides of one coin.
For example I have created 1:N relationship in Contact considering that Contact is primary entity and Custom entity is related entity. When you open Custom entity N:1 relationships you see automatically created relationship between Contact and Custom entity, where Contact is primary entity and Custom entity is related entity.
Relationship behavior.
Working with N:1 and 1:N relationships, you can set Cascading Rules in the Relationship Behavior section.
Use Type of Behavior drop-down list. There are 4 options.
The first three options are permanent, and the last option, Configurable Cascading, let you to configure the cascading manually for each operation (Assign, Share, Unshare, Reparent, Delete, and Merge)
Mapping.
Also using these types of relationships (N:1 and 1:N) you can set attribute mapping.
This function lets you to automatically populate certain fields of the related records. You can use Generate Mapping button or do it manually by creating new attribute mapping.

In my example I’ve created for City and Phone new mappings between Contact and Custom entity. Then if I populate City and Phone fields within Contact record and then create new Custom entity record from Contact record I will have City and Phone attributes already populated.
N:N relationships.
Using this type you create direct relationship between selected records. There are no primary or related entities. In this case you can select multiple records in both interconnected entities.
Just set other entity, display option and display area.

Here is an example of N:N relationships between Account and Custom entity:
See Accounts in the Custom entity record.

See Custom entities in the Account Record
