简体   繁体   English

将数据从外部数据库绑定到 MS Dynamics CRM 子网格

[英]Bind data to MS Dynamics CRM sub grid from external database

I am not able to set lookup fields on MSCRM sub grid from external database.我无法从外部数据库在 MSCRM 子网格上设置查找字段。

I tried with the retrieve multiple plugin as:我尝试使用检索多个插件作为:

get the data from external database in datatable从外部数据库中获取数据表中的数据

EntityCollection entityCollection= (EntityCollection)context.OutputParameters["BusinessEntityCollection"];
Entity anyEntity= new Entity("entity");

anyEntity.Attributes["new_customerid"] = new EntityReference("contact", new Guid("B26EF3E7-BD68-E411-9447-00155D010B06"));
anyEntity.Attributes["new_address1"] ="value from datatable";

entityCollection.Entities.Add(anyEntity);

Except lookup type field I am able to bind all the fields to the sub grid from external database.除了查找类型字段,我能够将所有字段从外部数据库绑定到子网格。

This is expected since you cannot "look up" to a record in a different database.这是意料之中的,因为您无法“查找”不同数据库中的记录。 CRM enforces foreign key constraints on lookup fields so that you can only set a lookup value to point to an entity that actually exists in that CRM system. CRM 对查找字段强制执行外键约束,以便您只能设置查找值以指向该 CRM 系统中实际存在的实体。 You could however set the lookup to a value in CRM based on some value in the other database.但是,您可以根据其他数据库中的某个值将查找设置为 CRM 中的某个值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM