locked
Change CRM Quote state RRS feed

  • Question

  • Greetings!

    Where can I find information on changing the state of a quote in crm (i.e. from active to draft) through the SDK? I need to do this to then allow the user to "revise" the quote through my web app.

    Thanks!


    Eduardo
    Thursday, June 18, 2009 12:38 PM

Answers

  • Hi Eduardo,

    look for "SetStateQuote Message" in the SDK
    Viele Grüße

    Michael Sulz
    axcentro GmbH
    Thursday, June 18, 2009 1:26 PM
  • Thursday, June 18, 2009 2:07 PM
  • You can not convert from Active to Draft, in order to edit it you have convert it to Revise. Here is code sinnpet for it.

    quoteclose qc = new quoteclose();
    qc.quoteid = new Lookup(EntityName.quote.ToString(), quoteid);
    CloseQuoteRequest cqr = new CloseQuoteRequest();
    cqr.QuoteClose = qc;
    cqr.Status = 7;
    CloseQuoteResponse resp = (CloseQuoteResponse)ConnectToCrm().Execute(cqr);
    Then you can create a new revision
    ReviseQuoteRequest rqr = new ReviseQuoteRequest();
    rqr.QuoteId = quoteid;
    rqr.ColumnSet = new AllColumns();
    ReviseQuoteResponse rqresp = (ReviseQuoteResponse)ConnectToCrm().Execute(rqr);
    quote quoteDraft = rqresp.BusinessEntity as quote;

    Thanks,
    Amol Gholap
    http://mscrmkb.blogspot.com
    Thursday, June 18, 2009 9:47 PM

All replies

  • Hi Eduardo,

    look for "SetStateQuote Message" in the SDK
    Viele Grüße

    Michael Sulz
    axcentro GmbH
    Thursday, June 18, 2009 1:26 PM
  • Thursday, June 18, 2009 2:07 PM
  • You can not convert from Active to Draft, in order to edit it you have convert it to Revise. Here is code sinnpet for it.

    quoteclose qc = new quoteclose();
    qc.quoteid = new Lookup(EntityName.quote.ToString(), quoteid);
    CloseQuoteRequest cqr = new CloseQuoteRequest();
    cqr.QuoteClose = qc;
    cqr.Status = 7;
    CloseQuoteResponse resp = (CloseQuoteResponse)ConnectToCrm().Execute(cqr);
    Then you can create a new revision
    ReviseQuoteRequest rqr = new ReviseQuoteRequest();
    rqr.QuoteId = quoteid;
    rqr.ColumnSet = new AllColumns();
    ReviseQuoteResponse rqresp = (ReviseQuoteResponse)ConnectToCrm().Execute(rqr);
    quote quoteDraft = rqresp.BusinessEntity as quote;

    Thanks,
    Amol Gholap
    http://mscrmkb.blogspot.com
    Thursday, June 18, 2009 9:47 PM