OneToManyRelationshipMetadata Class

Metadata for a one-to-many entity relationship.

Constructor

OneToManyRelationshipMetadata(schema_name: str, referenced_entity: str, referencing_entity: str, referenced_attribute: str, cascade_configuration: ~PowerPlatform.Dataverse.models.relationship.CascadeConfiguration = <factory>, referencing_attribute: str | None = None, additional_properties: ~typing.Dict[str, ~typing.Any] | None = None)

Parameters

Name Description
schema_name
Required
str

Schema name for the relationship (e.g., "new_Account_Orders").

referenced_entity
Required
str

Logical name of the referenced (parent) entity.

referencing_entity
Required
str

Logical name of the referencing (child) entity.

referenced_attribute
Required
str

Attribute on the referenced entity (typically the primary key).

cascade_configuration

Cascade behavior configuration.

Default value: <factory>
referencing_attribute

Optional name for the referencing attribute (usually auto-generated).

Default value: None
additional_properties

Optional dict of additional properties to include in the Web API payload. Useful for setting inherited properties like "IsValidForAdvancedFind", "IsCustomizable", "SecurityTypes", etc. These are merged last and can override default values.

Default value: None

Methods

to_dict

Convert to Web API JSON format.

Example:


   >>> rel = OneToManyRelationshipMetadata(
   ...     schema_name="new_account_orders",
   ...     referenced_entity="account",
   ...     referencing_entity="new_order",
   ...     referenced_attribute="accountid"
   ... )
   >>> rel.to_dict()
   {
       '@odata.type': 'Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata',
       'SchemaName': 'new_account_orders',
       'ReferencedEntity': 'account',
       'ReferencingEntity': 'new_order',
       'ReferencedAttribute': 'accountid',
       'CascadeConfiguration': {...}
   }

to_dict

Convert to Web API JSON format.

Example:


   >>> rel = OneToManyRelationshipMetadata(
   ...     schema_name="new_account_orders",
   ...     referenced_entity="account",
   ...     referencing_entity="new_order",
   ...     referenced_attribute="accountid"
   ... )
   >>> rel.to_dict()
   {
       '@odata.type': 'Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata',
       'SchemaName': 'new_account_orders',
       'ReferencedEntity': 'account',
       'ReferencingEntity': 'new_order',
       'ReferencedAttribute': 'accountid',
       'CascadeConfiguration': {...}
   }
to_dict() -> Dict[str, Any]

Attributes

additional_properties

additional_properties: Dict[str, Any] | None = None

cascade_configuration

cascade_configuration: CascadeConfiguration

referenced_attribute

referenced_attribute: str

referenced_entity

referenced_entity: str

referencing_attribute

referencing_attribute: str | None = None

referencing_entity

referencing_entity: str

schema_name

schema_name: str