locked
Allow Revisions in CRM Quotes RRS feed

  • Question

  • Hi,

    I'm developed a web application that allows the users to create and activate quotes in CRM. The application was succesfully implemented 2 weeks ago, but now the users want to be able to "Edit" a quote after it is active.

    I told them that CRM supports revisions, and they are fine with thst idea.

    How can I allow the user to revise a quote from my Web App after a quote has been activated? I'm already using CRM web service for many of the functions in my web app, so I'm assuming that this same tool can help me get started.

    I'll take any code, articles, books ...

    Thank you so much!
    Eduardo
    Wednesday, June 17, 2009 10:08 PM

Answers

  • Eduardo,

    CRM has set of rules to perform the operations. For quote there are states like Draft, Active , Lose , Won , Revise.
    If your quote is in Draft state you would be able to create or edit the Quote however once you activate the Quote you no longer able to edit.
    So in order enable editing you have to change the state of Quote to Revise. You can provide dropdown on your web form which will have values Activate, Revise. If user select the Revise, you call CRM webservices to change the state of quote using SetStateQuote message. Now user can edit the quote.


    Let me know if you have any further issues.

    Thanks,
    Amol Gholap
    http://www.mscrmkb.blogspot.com/

    Amol
    Thursday, June 18, 2009 2:12 AM
  • Here is a sample code for Account. You need to implement similarly for quote.
    From http://msdn.microsoft.com/en-us/library/bb959523.aspx :

    // Set up the CRM Service.
    CrmAuthenticationToken token = new CrmAuthenticationToken();
    // You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
    token.AuthenticationType = 0;
    token.OrganizationName = "AdventureWorksCycle";

    CrmService service = new CrmService();
    service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
    service.CrmAuthenticationTokenValue = token;
    service.Credentials = System.Net.CredentialCache.DefaultCredentials;

    // Create the request object.
    SetStateAccountRequest state = new SetStateAccountRequest();

    // Set the properties of the request object.
    state.AccountState = AccountState.Inactive;
    state.AccountStatus = 2;

    // EntityId is the GUID of the account whose state is being changed.
    state.EntityId = new Guid("AD618DB2-F0DB-4A6A-8C4B-2F2213EAA38E");;

    // Execute the request.
    SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);
    Thursday, June 18, 2009 2:15 PM

All replies

  • Eduardo,

    CRM has set of rules to perform the operations. For quote there are states like Draft, Active , Lose , Won , Revise.
    If your quote is in Draft state you would be able to create or edit the Quote however once you activate the Quote you no longer able to edit.
    So in order enable editing you have to change the state of Quote to Revise. You can provide dropdown on your web form which will have values Activate, Revise. If user select the Revise, you call CRM webservices to change the state of quote using SetStateQuote message. Now user can edit the quote.


    Let me know if you have any further issues.

    Thanks,
    Amol Gholap
    http://www.mscrmkb.blogspot.com/

    Amol
    Thursday, June 18, 2009 2:12 AM
  • Amol,

    Yes, I understand that I need to change the state of the quote. What I was hoping for was some type of artlicle that would show me how to code from the active to revision state thorugh the SDK or something like that.

    If you know about any articles, I would gretaly appreciate if you could share them.

    Thanks!
    Eduardo
    Thursday, June 18, 2009 12:34 PM
  • Here is a sample code for Account. You need to implement similarly for quote.
    From http://msdn.microsoft.com/en-us/library/bb959523.aspx :

    // Set up the CRM Service.
    CrmAuthenticationToken token = new CrmAuthenticationToken();
    // You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
    token.AuthenticationType = 0;
    token.OrganizationName = "AdventureWorksCycle";

    CrmService service = new CrmService();
    service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
    service.CrmAuthenticationTokenValue = token;
    service.Credentials = System.Net.CredentialCache.DefaultCredentials;

    // Create the request object.
    SetStateAccountRequest state = new SetStateAccountRequest();

    // Set the properties of the request object.
    state.AccountState = AccountState.Inactive;
    state.AccountStatus = 2;

    // EntityId is the GUID of the account whose state is being changed.
    state.EntityId = new Guid("AD618DB2-F0DB-4A6A-8C4B-2F2213EAA38E");;

    // Execute the request.
    SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);
    Thursday, June 18, 2009 2:15 PM