locked
The price cannot be overridden while the entity is locked in mscrm 2013 through plugin RRS feed

  • Question

  • Dear all;

    i am trying to update the order product through plugin but i am receiving the following error

    The price cannot be overridden while the entity is locked

    i tried  the below code but still not working

     bool check = (bool)quote_product.Attributes["salesorderispricelocked"];
                                if (check)
                                {
                                    if (quote_product.Attributes.Contains("productid"))
                                    {
                                        quote_product.Attributes.Remove("productid");
                                    }
                                    if (quote_product.Attributes.Contains("uomid"))
                                    {
                                        quote_product.Attributes.Remove("uomid");
                                    }
                                    if (quote_product.Attributes.Contains("priceperunit_base"))
                                    {
                                        quote_product.Attributes.Remove("priceperunit_base");
                                    }
                                    if (quote_product.Attributes.Contains("priceperunit"))
                                    {
                                        quote_product.Attributes.Remove("priceperunit");
                                    }
                                    service.Update(quote_product);
                                }
                                else
                                {
                                    service.Update(quote_product);
                                }
    • Edited by anwar_addi Monday, March 3, 2014 2:18 PM
    Monday, March 3, 2014 2:01 PM

All replies

  • Hi Anwar,

        Please check the below link

    http://nzcrmguy.blogspot.co.uk/2011/05/c-plugin-update-error-product-and-unit.html

    http://social.msdn.microsoft.com/Forums/en-US/7d47a009-38a0-4dc6-9a95-4db82221cd62/crm4-update-triggering-entity-with-retrieved-data-in-child-pipeline-is-it-even-possible?forum=crmdevelopment

    Thanks

    T.Vinoth


    • Edited by Vinoth Thiru Monday, March 3, 2014 5:13 PM Added
    • Proposed as answer by Vinoth Thiru Tuesday, March 4, 2014 8:07 PM
    Monday, March 3, 2014 5:11 PM