解决方案是使用后期绑定的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);