CreateManyToManyRequest

// ** CreateManyToManyRequest **

//Ex: creates the entity relationship between the Account and Contact entities by using CreateManyToManyRequest.

 

CreateManyToManyRequest createManyToManyRelationshipRequest = new CreateManyToManyRequest

    {

        IntersectEntitySchemaName = "new_accounts_campaigns",

        ManyToManyRelationship = new ManyToManyRelationshipMetadata

        {

            SchemaName = "new_accounts_campaigns",

            Entity1LogicalName = "account",

            Entity1AssociatedMenuConfiguration =

            new AssociatedMenuConfiguration

            {

                Behavior = AssociatedMenuBehavior.UseLabel,

                Group = AssociatedMenuGroup.Details,

                Label = new Label("Account", 1033),

                Order = 10000

            },

            Entity2LogicalName = "campaign",

            Entity2AssociatedMenuConfiguration =

            new AssociatedMenuConfiguration

            {

                Behavior = AssociatedMenuBehavior.UseLabel,

                Group = AssociatedMenuGroup.Details,

                Label = new Label("Campaign", 1033),

                Order = 10000

            }

        }

    };

 

CreateManyToManyResponse createManytoManyRelationshipResponse =

    (CreateManyToManyResponse)_service.Execute(

    createManyToManyRelationshipRequest);