我刚刚收到了对 asp.net webforms 应用程序的需求,它必须与 MS Dynamics 365 CRM 集成。我从来没有为 Dynamics 365 做过开发,但无论如何我已经设法使用 .net sdk 连接到 CRM 并创建了一个潜在客户和销售文献实体。我的意图是通过以下方式实现我们可以做的事情Dynamics 365 portal --> Lead --> related --> Activities--> Sales Literature
:
因此,我想使用 .net sdk 在这两个实体(潜在客户和销售文献)之间建立关系,这是我的代码:
AssociateRequest association = new AssociateRequest
{
Target = new EntityReference(leadEntity.LogicalName, leadid),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference(SLEntity.LogicalName, SLID)
},
Relationship = new Relationship("Lead_SalesLiterature"),
RequestId = new Guid()
};
// Execute the request.
CRMService.Execute(association);
但是代码无法建立这样的关系CRMService.Execute(association);
:
System.ServiceModel.FaultException`1:“在 MetadataCache 中找不到与 SchemaName = 'SalesLiterature_Lead' 的实体关系”