感谢@DChhapgar帮助我弄清楚如何添加"草稿电子邮件"然而,当我试图运行我在@DChhapgar指令后创建的代码时,我得到的错误如下:
错误#13:插入'活动'记录引发一个或多个错误。请查阅。错误:'来自'可能不是空的
我的代码如下:
CR304000Content CR304000 = context.CR304000GetSchema();
context.CR304000Clear();
//Email Activity Screen
CR306015Content CR306015 = context.CR306015GetSchema();
context.CR306015Clear();
//Locate Opportunity for which Email Draft needs to be added
CR304000Content[] CR304000result = context.CR304000Submit(
new Command[]
{
new Value { Value = opportunity.ID, LinkedCommand = CR304000.OpportunitySummary.OpportunityID},
//Invoke New Email Actity Action
CR304000.Actions.NewMailActivity
});
//Specify data for Email Activity
if (!string.IsNullOrWhiteSpace(email.Subject))
{
CR306015Content[] CR306015result = context.CR306015Submit(
new Command[]
{
new Value { Value = "abcd@efg.com", LinkedCommand = CR306015.Message.FromMailAccountID},
new Value { Value = email.ToAddress, LinkedCommand = CR306015.Message.To},
new Value { Value = email.Subject, LinkedCommand = CR306015.Message.Subject },
new Value { Value = email.Message, LinkedCommand = CR306015.Message_.ActivityDetails},
CR306015.Actions.Save,
});
}
我看到有三个与电子邮件相关的字段"来自"在Web服务规范中:CR306015.Message.FromMailAccountID,CR306015.Message.FromEmailAccountID,CR306015.Message.FromMailFrom,但它们都不适用于我。
我错过了什么吗?
答案 0 :(得分:0)
我猜测FromMailAccountID
需要是一个整数。查看现有记录的值。