0

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)
                };
Cœur
  • 37,241
  • 25
  • 195
  • 267
Rahul J
  • 103
  • 1
  • 11
  • 2
    Can you post what you've tried? See [how to ask a good question](http://stackoverflow.com/help/how-to-ask). – Lews Therin May 11 '16 at 11:36
  • 1
    Post a full code segment that we can review and attempt to execute? Also, what error message are you getting? Lastly, is this CRM 2011 or CRM 2016 - narrow down your tag to a specific version. – Nicknow May 11 '16 at 13:26
  • I was missing with the entity reference guid, now i am able to create a connection with the above code. Thanks – Rahul J May 12 '16 at 08:29

0 Answers0