Skip to main content

Relationships

Relationship steps manage the connections between Dynamics 365 records—associating and disassociating related entities.

Associate Relationship

Links two records via a relationship.

ParameterDescription
EntityThe primary entity type
Entity IDThe primary record ID
RelationshipThe relationship schema name
Related EntityThe entity type to associate
Related Entity IDThe ID of the record to associate

Example:

ASSOCIATE RELATIONSHIP
Entity: Account
Entity ID: Customer.Id
Relationship: account_contacts
Related Entity: Contact
Related Entity ID: NewContact.Id

Associate Multiple Relationships

Links multiple records to a single record in one operation.

ParameterDescription
EntityThe primary entity type
Entity IDThe primary record ID
RelationshipThe relationship schema name
EntitiesCollection of records to associate

This step is more efficient than calling Associate Relationship multiple times in a loop.

Example:

ASSOCIATE MULTIPLE RELATIONSHIPS
Entity: Team
Entity ID: SalesTeam.Id
Relationship: teammembership_association
Entities: NewTeamMembers

Disassociate Relationship

Removes the link between two records.

ParameterDescription
EntityThe primary entity type
Entity IDThe primary record ID
RelationshipThe relationship schema name
Related EntityThe entity type to disassociate
Related Entity IDThe ID of the record to disassociate

Example:

DISASSOCIATE RELATIONSHIP
Entity: Account
Entity ID: Customer.Id
Relationship: account_contacts
Related Entity: Contact
Related Entity ID: FormerContact.Id

Disassociate Multiple Relationships

Removes links between multiple records and a single record in one operation.

ParameterDescription
EntityThe primary entity type
Entity IDThe primary record ID
RelationshipThe relationship schema name
EntitiesCollection of records to disassociate

Example:

DISASSOCIATE MULTIPLE RELATIONSHIPS
Entity: Campaign
Entity ID: Campaign.Id
Relationship: campaignitem_association
Entities: RemovedProducts

Get Entities by Relationship

Retrieves records related to a given record via a specific relationship.

ParameterDescription
Relationship TypeThe cardinality: 1-1 (one-to-one) or 1-N (one-to-many)
EntityThe primary entity type
Entity IDThe primary record ID
RelationshipThe relationship schema name
Related EntityThe related entity type to retrieve

Returns: Single record (1-1) or collection of related records (1-N)

Example - One-to-Many:

GET ENTITIES BY RELATIONSHIP
Relationship Type: 1-N
Entity: Account
Entity ID: Customer.Id
Relationship: account_contacts
Related Entity: Contact
→ Store in variable: CustomerContacts

Example - One-to-One:

GET ENTITIES BY RELATIONSHIP
Relationship Type: 1-1
Entity: Contact
Entity ID: Contact.Id
Relationship: contact_customer_account
Related Entity: Account
→ Store in variable: ParentAccount

Best Practices

Use Correct Relationship Names: Always use the exact relationship schema name from Dynamics 365. You can find this in the entity customization area.

Batch When Possible: Use Associate Multiple / Disassociate Multiple when working with several records to improve performance.

Check Existing Relationships: Before associating, consider whether the relationship already exists to avoid duplicate relationship errors.

Handle Many-to-Many Carefully: Many-to-many relationships require using the intersect entity relationship name.