Commerce > Administration > System settings > Adding a many-to-1 relation

Adding a many-to-one relationship

This topic is intended for administrators and developers with administration access rights in Episerver.

You can relate business objects with a many-to-one (N:1) relationship. For example, you can relate multiple contacts to a single organization or unit.

In the following example, N = Organization and 1 = Related Objects such as ParentId, PrimaryContactId and so on.

  1. To create many-to-one relationships, select a business object and click the N:1 Relations tab.

  2. Click New Relation "Many to one" to create a new relationship.

  3. Fill in the Relation N:1 dialog box. (The Relation N:1 form is very similar to the Relation 1:N form, except you can select the Primary Object from the drop-down, whereas the Related Object defaults to the name of the Business Object.)
    • Primary Object. Select the drop-down item to relate an the Organization object.
    • Related Object. Automatically set to Organization.
    • Field Name. Automatically populated using the system name of the business object, but must be unique from an existing field name. Use only letters, numbers and underscores (_); no spaces or special characters.
    • Friendly Name. Automatically populated using the system name of the business object. You can change it, but must be unique from an existing field name (special characters and spaces are permitted).
    • Allow Nulls. Select the box to make this an optional field that the user fills in while editing a form. Deselect the box to make it a required field.
    • Add Field To. Select the Forms you want the field to render in, such as the Edit Form (to enter and submit information) or View Form (read information only).
    • Display Region. Select a region in the drop-down box. Additional options, such as Display Text and Display Order, appear based on your drop-down menu selection.
  4. Click Save.

Like an 1:N relationship, if you create a N:1 relationship with a Primary and Related Object, a 1:N relationship is automatically generated for the Primary Object on the 1:N tab.

back to top

Episerver User Guide update 16-2 | Released: 2016-03-31 | © Episerver 2016 | Send feedback to us