External relationships
Database tables typically have primary key to foreign key relationships between records. Platform can wrap these relationships the same way as native relationships between objects.
A field of an external object (database column) can serve as a primary key if:
- Its type is text or integer
- It has a "unique value" attribute
When creating fields for new external object, you can select a Foreign Key data type for text or integer database columns. In this case you need to select a Primary Key too.
If you do not define a relationship when you create the external object, you can do it later. On the object view page, from the Relationships section, click New External Relationship. Select an unused DB column which can serve as a foreign key (if any), and select a primary key on another external object. The types of the two key columns must match. In both cases, the system will create a relationship between two external objects that works much the same way as normal object relationships. The relationship will be in the form of primary key to foreign key and only one-to-one and one-to-many relationships are supported.

Note that relationships involving external objects support only the following scenarios:
- 1-1 or 1-N cardinality when establishing a relationship between an external object and another external object or a Platform native object
- 1-1 or N-1 cardinality when establishing a relationship between a Platform native object and an external object