val*_*lch 4 c# web-services crm dynamics-crm dynamics-crm-2011
如何在crm 2011中创建和删除多对多实体关系中的数据?
码:
QueryExpression qry = new QueryExpression();
qry.EntityName = "entity1_entity2";
qry.ColumnSet = new ColumnSet(true);
var re = crmservice.RetrieveMultiple(qry).Entities;
crmservice.Delete("entity1_entity2", re[0].Id);
Run Code Online (Sandbox Code Playgroud)
FaultException类型: The 'Delete' method does not support entities of type 'entity1_entity2'.
using Microsoft.Crm.Sdk.Messages;
...
// get the crm service
...
AssociateEntitiesRequest fooToBar = new AssociateEntitiesRequest
{
Moniker1 = foo, // foo is an entity reference
Moniker2 = bar, // bar is an entity reference
RelationshipName = "foo_bar", // name of the relationship
}
service.Execute(fooToBar) // relates foo and bar
Run Code Online (Sandbox Code Playgroud)
这是一篇博客文章:http://charithrajapaksha.blogspot.com/2011/08/creating-many-to-many-records-in-crm.html
| 归档时间: |
|
| 查看次数: |
9488 次 |
| 最近记录: |