Create a connection with connection role between account and contact entity- programmatically

时间:2016-05-11 11:30:44

标签: c# dynamics-crm dynamics-crm-2016

I am trying to create a connection with connection role (Eg:test) between account entity and contact entity through c# code.

Can anyone tell me/share me code as to how to achieve this progamatically.

i got this reference from msdn..... but i am not able to do this.

 _serviceProxy.EnableProxyTypes();

                Connection newConnection = new Connection
                {
                    Record1Id = new EntityReference(Account.EntityLogicalName,
                        _accountId),
                    Record1RoleId = new EntityReference(ConnectionRole.EntityLogicalName,
                        _connectionRoleId),
                    Record2RoleId = new EntityReference(ConnectionRole.EntityLogicalName,
                        _connectionRoleId),
                    Record2Id = new EntityReference(Contact.EntityLogicalName,
                        _contactId)
                };

0 个答案:

没有答案