Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Activate and Close Quote via Late Bound

$
0
0

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);
}


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>