This project has moved. For the latest updates, please go here.

Add-CrmRelationship

Synopsis

Add new relationship

Syntax

Add-CrmRelationship [-Entity1] <String> [-Entity2] <String> [-Name] <String> [-IntersectName] <String> [-AdvancedFind <Nullable`1[Boolean]>] [-Customizable <Nullable`1[Boolean]>] [<CommonParameters>]

Add-CrmRelationship [-Entity] <String> [-ToEntity] <String> [-Name] <String> -AttributeName <String> -AttributeDisplayName <String> [-AttributeDescription <String>] [-AttributeRequired <CrmRequiredLevel>] [-AdvancedFind <Nullable`1[Boolean]>] [-Customizable <Nullable`1[Boolean]>] [<CommonParameters>]

Description

Adds a new relationship between two entities, including the Lookup field for a one-to-many relationship.

Parameters

-Entity1 <String>

Logicalname of one entity in a many-to-many relationship

Required? True
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Entity2 <String>

Logicalname of one entity in a many-to-many relationship

Required? True
Position? 2
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Name <String>

Schemaname for the relationship

Required? True
Position? 3
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-IntersectName <String>

Schemaname of the Intersect entity for a many-to-many relationship

Required? True
Position? 4
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-AdvancedFind <Nullable`1[Boolean]>

Available in Advanced Find

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Customizable <Nullable`1[Boolean]>

Is customizable

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Entity <String>

Referencing entity in a one-to-many relationship.

Required? True
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ToEntity <String>

Referenced entity in a one-to-many relationship.

Required? True
Position? 2
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-AttributeName <String>

Logicalname for the lookup attribute in a one-to-many relationship.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-AttributeDisplayName <String>

Displayname for the lookup attribute in a one-to-many relationship.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-AttributeDescription <String>

Description for the lookup attribute in a one-to-many relationship.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-AttributeRequired <CrmRequiredLevel>

Required-level for the lookup attribute in a one-to-many relationship.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, InformationAction, InformationVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable and OutVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

Outputs

Microsoft.Xrm.Sdk.Metadata.RelationshipMetadataBase

Notes

Available parameters depend on the version of the connected organization and the SDK used

Examples

Related links

RelationshipMetadataBase Class https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.relationshipmetadatabase.aspx

Last edited Mar 11 at 7:02 PM by amsoftware, version 2