2014-11-03 84 views
1

我正在嘗試添加聯繫人的電話聯絡活動。我使用下面的代碼來添加活動,但我在活動列表中看不到它。爲什麼我的代碼無法添加活動?

var ContactId = guid; //Contact GUID 

var trigger = new XrmServiceToolkit.Soap.BusinessEntity("phonecall"); 
trigger.attributes["subject"] = "Hello"; 
trigger.attributes["regardingobjectid"] = 
        { id: ContactId, logicalName: "Contact", type: "EntityReference" }; 

triggerId = XrmServiceToolkit.Soap.Create(trigger); 

} 

請建議我是否缺少任何東西。

回答

2

您需要作爲logicalName傳入聯繫人。 此:

{ id: ContactId, logicalName: "Contact", type: "EntityReference" }; 

應該是:

{ id: ContactId, logicalName: "contact", type: "EntityReference" }; 
相關問題