Relationships

You can define relationships between objects in order to link interrelated documents. For instance, an offer could contain an offer document and a related price list along with a company brochure. Each object can be updated separately and they have separate version histories. The objects do not need to be copied unnecessarily.

You can access the Relationships dialog either via the context menu of an object or by selecting an object, then pressing the Alt key on your keyboard, and selecting Operations > Relationships.

Note: You need to have the object checked out to make any modifications to its relationships.

The "Relationships" dialog.

By using relationships, you can define metadata connections between objects, just as via the metadata card. For example, you can link a customer with an object. The customer then also appears in the object's metadata. Likewise, the relationships entered via the metadata card will appear in the Relationships window.

The dialog window contains three tabs representing the relationships from and relationships to the object, as well as one for all relationships.

Tip: You can utilize the properties of a related object in creating indirect views and searches or in defining filter settings (see Indirect searches under Advanced Search).

Add Relationship, Edit Relationship, Remove Relationship

Use the buttons along the bottom of the dialog to add, edit, and remove relationships. To add several objects at once, you can drag and drop objects from other windows.

Latest version, Specific version

When you add a relationship, M-Files prompts for the desired behavior regarding the version of the added object. You can set the relationship to always apply to the latest version or to the current version.

Adding a Relationship Between Two Objects

Steps

  1. In M-Files, locate and highlight the object from which you want to add a relationship to another object.
  2. Either:
    1. Press ALT to display the menu bar and select Operations > Relationships.
      or
    2. Right-click the object and select Relationships.
  3. Either on the Relationships From This Object or All Relationships tab, click the Add Relationship... button.
  4. In the Select Target Object window, locate the object to which you want to add a relationship from this object and click Open.
  5. Select either:
    1. Latest version if you want the relationship to always point to the latest version of the object.
      or
    2. Specific version if you want to add a relationship to the current version of the object, so that if the object is updated, the relationship still points to the object version that was the latest version of the object when the relationship was created.
  6. Click OK to create the relationship.

Results

The objects between which you have added the relationship should now have relationship links to each other. When you expand either of the objects in the listing area, you should see the linked object under the node representing the type of the referenced object, for instance Documents or Customers.

Relationships Between Objects in Separate Vaults

Relationships can also be created between objects residing in different vaults. Then the objects are not exported from a vault to another but the relationship is created by referring to an object in another vault, that is, a link is created to the original object.

You can create a relationship by dragging an object from one vault to another or by using the Relationships function in the same way as when adding a relationship to an object in the same vault.

In addition, you can replace a file with a file in another vault as if the two files were in the same vault.

Shortcuts

The related object in another vault is displayed as a shortcut in the target vault. When you double-click this object, M-Files shows the object in the original vault in the same way as when M-Files shortcuts are used.

In the target vault, you can see the basic properties of the related object (shortcut) and information for the original vault, but the actual changes and opening of the object are performed in the original vault. You must have permissions for the original vault and original object if you want to view and edit the related object in the original vault.

You can rename the shortcut in the target vault if so desired; this change does not change the name of the original object in the source vault and does not cause any conflicts between vaults.

Shortcut permissions

The shortcuts have their own permissions. The default setting is the target vault's default permission for new objects set by object type.

Shortcuts created through synchronization

When data is synchronized between vaults, for such purposes as archiving or publishing, shortcuts are created in certain cases through metadata of the imported objects. For example, if a document related to a certain project is imported to the target vault but the project is not imported, M-Files creates a shortcut for the project in the target vault. Then this shortcut is a link to an object in the other vault. The requirement is that the Project property definition be associable between the source and target vaults. The metadata definitions themselves must always be associable so that their related objects and values can be displayed or imported as shortcuts.

Requirements

M-Files automatically creates a relationship to objects that have a built-in object type (for instance, Document or Document collection). If the object type of the object is created by the user (Customer, Project, etc.), you should ensure that the metadata definitions of the object types can be matched between vaults.