Activate and Close Quote via Late Bound RRS feed

  • Question

  • 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)

    //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),

    Sunday, September 1, 2013 10:51 AM


All replies

  • Hi,

    Please refer to following link to execute activateQuoteRequest and closeQuoteRequest


    and refer following link to check the status values


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    • Proposed as answer by HIMBAPModerator Monday, September 2, 2013 7:12 AM
    • Marked as answer by DarinBrowne Monday, September 2, 2013 10:35 AM
    Sunday, September 1, 2013 2:33 PM
  • _Vikram - your link uses the SetStateRequest - you don't use that when closing quotes; you'll need to create a closequote entity instance.

    Here's an example:

    // Late bound CloseQuoteRequest
    Entity quoteClose = new Entity("quoteclose");
    quoteClose["subject"] = _subject;
    quoteClose["quoteid"] = _record;
    CloseQuoteRequest closeQuoteRequest = new CloseQuoteRequest()
                            QuoteClose = quoteClose,
                            Status = _statuscode

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful. Michael Mayo

    Wednesday, January 28, 2015 9:51 AM