Dynamics CRM 2013 向けに開発しています。Quote の状態を変更しようとしましたが、QuoteState が見つからないようです。QuoteState.Active を使用しようとしましたが、「名前 'QuoteState' は現在のコンテキストに存在しません」というエラーが表示されます。これらは私が使用する名前空間です:
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Crm.Sdk;
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xrm;
どの名前空間が欠落しているか、または何が間違っていますか?
編集:
これは私が使用しようとしている関数です:
/// <summary>
/// Activates the Quote
/// </summary>
/// <param name="quote">The quote</param>
/// <param name="xrm">The Xrm Service Context</param>
private static void ActivateQuote(Quote quote, XrmServiceContext xrm)
{
SetStateRequest activateQuote = new SetStateRequest()
{
EntityMoniker = quote.ToEntityReference(),
State = new OptionSetValue((int)QuoteState.Active),
Status = new OptionSetValue(3)
};
SetStateResponse activateResponse = (SetStateResponse)xrm.Execute(activateQuote);
// Save
xrm.SaveChanges();
Console.WriteLine("Activated the quote...");
}
State = new OptionSetValue(1) を使用すると機能するため、 QuoteState が欠落しているだけです。