Entity.SetRelatedEntities<TEntity> Method (String, Nullable<EntityRole>, IEnumerable<TEntity>)
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Sets the collection of related entity instances for the specified relationship.
Namespace: Microsoft.Xrm.Sdk
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
Syntax
protected virtual void SetRelatedEntities<TEntity>(
string relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole,
IEnumerable<TEntity> entities
)
where TEntity : Entity
Protected Overridable Sub SetRelatedEntities(Of TEntity As Entity) (
relationshipSchemaName As String,
primaryEntityRole As Nullable(Of EntityRole),
entities As IEnumerable(Of TEntity)
)
Parameters
relationshipSchemaName
Type: System.StringType: String. The schema name of the relationship.
primaryEntityRole
Type: System.Nullable<EntityRole>Type: EntityRole. The role of the primary entity in the relationship (referenced or referencing).
entities
Type: System.Collections.Generic.IEnumerable<TEntity>Type: IEnumerable. The collection of entity instances to set.
Type Parameters
- TEntity
Type: Entity. The type of the entity.
Examples
SetRelatedEntities<ActivityPointer>("Account_ActivityPointers", null, value);
See Also
Entity Class
Microsoft.Xrm.Sdk Namespace
Return to top
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright