我正在使用 CRM 4.0 Web 服务界面开发应用程序,需要以编程方式创建电话记录并将其链接到帐户记录。我可以看到如何创建记录,但我不确定如何将电话链接到帐户。任何帮助将非常感激。
谢谢
奈杰尔
我正在使用 CRM 4.0 Web 服务界面开发应用程序,需要以编程方式创建电话记录并将其链接到帐户记录。我可以看到如何创建记录,但我不确定如何将电话链接到帐户。任何帮助将非常感激。
谢谢
奈杰尔
您不能将活动(如电话)直接链接到实体(如帐户)。您必须使用 activityparty 对象来执行此操作。
要做到这一点,请按照以下步骤操作(我假设该帐户存在):
phonecall newPhoneCall = new phonecall ();
// Set the properties of the newPhoneCall.
newPhoneCall.subject = "Test newPhoneCall";
newPhoneCall.description = "New newPhoneCall";
// Create the party sending and receiving the newPhoneCall.
activityparty party = new activityparty();
// Set the properties of Activityparty.
party.partyid = new Lookup();
party.partyid.type = EntityName.account.ToString();
party.partyid.Value = existingAccount.accountId;
// The party sends and receives the newPhoneCall.
newPhoneCall.from = new activityparty[] { };
newPhoneCall.to = new activityparty[] { party };
然后像往常一样创建电话呼叫活动。