`if (!string.IsNullOrEmpty(phonecall.From))
phonecallEntity.Attributes.Add("from", new EntityReference("systemuser", new
Guid(phonecall.From)));
if (!string.IsNullOrEmpty(phonecall.To))
phonecallEntity.Attributes.Add("to", new EntityReference("contact", new
Guid(phonecall.To)));
我正在尝试在 Dynamics 365 中的电话呼叫活动中设置 from 和 to 字段。我使用以下代码,但在创建电话呼叫时 to 和 from 字段为空。我需要改变什么?
实体(行电话呼叫)上的to
和from
字段Activity
期望EntityCollection
, 而不是EntityReference
您尝试传递它们时的an 。
您中的每个实体都EntityCollection
应该ActivityParty
链接到一个EntityReference
:
// Create your collection.
var collection = new EntityCollection();
// Create your parties; one party per reference (to/from).
var party1 = new Entity("activityparty");
party["partyid"] = new EntityReference(logicalName, id);
// Add your parties to your collection.
collection.Entities.Add(party1);
// Set your to phone call's to field.
phoneCallEntity["to"] = collection;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句