This message uses a single transaction to create multiple associations between the record that is specified by the Id in the Target property and each record in the RelatedEntities property. The associations are created for the specified relationship in the Relationship property.

For a one-to-many relationship, this message sets the ReferencingAttribute property in the related record to the value of the Id in the Target.

For a many-to-many relationship, this message creates a record in the intersect table for the relationship, which contains the ID of both the referenced and referencing records. The intersect table name is defined in the IntersectEntityName property for the relationship. You need this when you query for the records. However, you need the relationship name to set the Relationship property. This name is defined in the SchemaName property for the relationship.

Supported Entities

You can use this message to associate records of any two entities (includes records for custom entities) that participate in a relationship. To find a list of the default relationships, see the Entity Metadata topic for each entity.