1

我想关闭插件的报价。一切正常在线,但如果我的插件在 Outlook 中离线运行,我会收到一个错误:

必须填充主键才能在离线模式下在富客户端上调用平台

我这样关闭引用:

CloseQuoteRequest req = new CloseQuoteRequest();
req.QuoteClose = myQuote;
req.Value = new OptionSetValue(6);
service.Execute(req);

我在离线时跟踪了我的插件,并且我的报价 ID 等属性都可以。

有人有什么想法吗?

4

1 回答 1

0

解决方案是使用后期绑定的quoteclose实体并提供activityid guid:

var item = service.retrieve("quote",quoteid, new columnset(true);
var quoteclose = new Entity("quoteclose");


quoteclose.Attributes.Add("quoteid", item.ToEntityReference());
quoteclose.Attributes.Add("subject", "Quote Closed");
quoteclose.Attributes.Add("description", "Quote Closed");
quoteclose.Attributes.Add("quotenumber", item.Attributes["quotenumber"]);
quoteclose.Attributes.Add("ownerid", item.Attributes["ownerid"]);
quoteclose.Attributes.Add("revision", 0);
quoteclose.Attributes.Add("activityid", Guid.NewGuid());
quoteclose.Attributes.Add("actualend", DateTime.Now);

// Close the quote
CloseQuoteRequest closeQuoteRequest = new CloseQuoteRequest()
{
     QuoteClose = quoteclose,
      Status = new OptionSetValue(5)
};
contextBag.Service.Execute(closeQuoteRequest);
于 2014-06-23T17:27:01.903 回答