I need to use late bound code to activate and then close a quote. The following is Early Bound code to accomplish this but can anyone translate it into Late Bound code?
public void CloseQuote(IOrganizationService service, Quote closeQuote)
{
//Activate the Quote
SetStateRequest activateQuote = new SetStateRequest()
{
EntityMoniker = closeQuote.ToEntityReference(),
State = new OptionSetValue((int)QuoteState.Active),
Status = new OptionSetValue((int)quote_statuscode.InProgress_2)
};
service.Execute(activateQuote);
//Close the Quote
CloseQuoteRequest closeQuoteRequest = new CloseQuoteRequest()
{
QuoteClose = new QuoteClose()
{
QuoteId = closeQuote.ToEntityReference(),
Subject = “Accepted ” + DateTime.Now.ToString()
},
Status = new OptionSetValue((int)quote_statuscode.Accepted),
};
service.Execute(closeQuoteRequest);
}