Dynamics Crm: creating Connection entities via API

为君一笑 提交于 2019-12-06 05:35:33

You just need to create one connection record. One thing to note is I don't think you need to set the typecodes as you are doing above. Just setting the logical names in the entity references should be enough. Here is the sample from the SDK:

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)
};
_connectionId = _serviceProxy.Create(newConnection);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!