Defining data associations among forms
Direct associations are primary key and foreign key associations between two forms. The multiple fields from the primary form can be used as a primary key and similarly, multiple fields from the secondary form can be used as a foreign key. In other words, each field in the primary key maps to a field in the foreign key and is called direct association.
The fields used for the primary key may or may not be uniquely indexed. In Developer Studio, you can create two types of direct associations: one-to-one association and one-to-many association.
You can use two different forms for creating direct associations in Developer Studio: primary form and secondary form. You can also enforce associations between these two forms. For information about how association enforcement works, see Associations-overview.
Direct associations are helpful when you can establish a primary key to foreign key associations between fields of two forms that you want to associate.
Highlights
- A direct association is a direct relationship between two forms.
- This association is used wherever there is a parent-child kind of relationship, such as purchase order to purchase order line item.
- This association supports one-to-one and one-to-many relationships.
- Multiple fields from the primary form can be the primary keys and similarly, multiple fields from the secondary form can be a foreign key.
The number of fields in the secondary form should be the same as the primary form. Each field of the primary key maps to a field in the foreign key. This association is also referred to as PKFK mapping. - The fields used for the primary key must be uniquely indexed for the best results.
Indirect associations
Indirect associations are associations created using an association form apart from primary and secondary forms. This form stores the foreign key for both the primary and secondary forms. Multiple fields from the primary form can be mapped to the same number of fields on the association form and similarly multiple fields from the secondary form can be mapped to same number of fields on association form. In Developer Studio, you can create three types of indirect associations: one-to-one association, one-to-many association, and many-to-many association. The following image shows at a high-level about how indirect associations work:
You can create indirect associations in Developer Studio with the help of an association form, along with the primary form and secondary form. You can also enforce associations between these forms. For information about how association enforcement works, see Associations-overview.
Highlights
- This type of association supports one-to-one, one-to-many, and many-to-many relationships
- This association is used for describing peer relationships or loose relationships such as a relationship between incident management and change management.
- Records in the two forms are related to each other by creating a record into a third form called the association form.
- The association form holds the foreign key for both primary and secondary forms.
- Multiple fields from the primary form can be mapped to the same number of fields on an association form and multiple fields from the secondary form can be mapped to the same number of fields on the association form.
For information about creating and modifying associations, see the following topics: