gpt4 book ai didi

c# - 在没有早期绑定(bind)实体的情况下在 CRM 中创建 ActivityParty

转载 作者:太空狗 更新时间:2023-10-29 19:55:51 25 4
gpt4 key购买 nike

作为一项要求,我不能使用通过“CrmSvcUtil”创建的早期绑定(bind)上下文。问题是新的电话调用事件需要两个字段('from' 和 'to'),它们是 activityparty 类型的 Entities。标准 XRM/CRM 命名空间不包含类似于使用实用程序创建的 ActivityParty 的类。

我尝试用 EntityCollection 填充它,但随后该字段将为空。接下来,我尝试重新创建一个有效的电话事件的结构。 EntityCollection "activityparty"-> 使用一个 Entity "activityparty"-> 使用 EntityReference 属性“partyid” -> 实体引用(例如“联系人”和联系人的 ID)。但它根本不起作用。

如何使用“普通”实体 类创建 ActivityParty(或更好的电话事件)?

最佳答案

如果我是对的,您不需要使用 EntityCollection,而是使用 Entity 的数组

要使用后期绑定(bind)语法创建电话调用将是:

Entity from1 = new Entity("activityparty");
Entity to1 = new Entity("activityparty");
Entity to2 = new Entity("activityparty"); // two contacts inside the to field

from1["partyid"]= new EntityReference("systemuser", userId);
to1["partyid"]= new EntityReference("contact", contact1Id);
to2["partyid"]= new EntityReference("contact", contact2Id);

Entity phonecall = new Entity("phonecall");

phonecall["from"] = new Entity[] { from1 };
phonecall["to"] = new Entity[] { to1, to2 };
// other phonecall fields

Guid phonecallId = service.Create(phonecall);

关于c# - 在没有早期绑定(bind)实体的情况下在 CRM 中创建 ActivityParty,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23389031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com