locked
Recalculate Quote using API RRS feed

  • Question

  • Hi all,

    I'm hoping to programatically, using the API, perform the same actions that are performed behind the scenes when someone clicks the Recalculate button on the Quote form.

    Basically I'm looking to programatically recalculate the price of all QuoteProducts for a Quote whose prices are not overridden.

    I've looked online to see if there are any CRM Messages to perform this task, but couldn't find any that looked like what I was looking for, so I'm not sure how to fire off a recalc process on the QuoteProducts.

    Has anybody tried to do this, or at least know what approach I need to take to perform this?

    Thanks for any sage advice.
    Wednesday, August 26, 2009 5:07 PM

Answers

  • Not 100% sure about this but I think the quote is recalculated as the status on the quote is changed. Perhaps you can use that to trigger the recalculation and then change the status back again.

    /c
    Wednesday, August 26, 2009 7:47 PM

All replies

  • The Recalculate button executes a lot of Javascript which means there's no SDK messages to mimic that process.  I believe you can capture the clicking of the Recalculate button though, and fire your code at that point.  This might be easier to accomplish with a custom web service which calls the CRM web service, then you call the custom web service with JavaScript.

    We tried hooking into the Recalc process with javascript on the onsave event of the quote, but the onsave code is fired before the recalc code so all our values were overwritten.
    Wednesday, August 26, 2009 6:02 PM
  • Not 100% sure about this but I think the quote is recalculated as the status on the quote is changed. Perhaps you can use that to trigger the recalculation and then change the status back again.

    /c
    Wednesday, August 26, 2009 7:47 PM