locked
Update Opportunity From Quote RRS feed

  • Question

  • Hello All,

    Is there any one with a plugin example that shows how to update a custom field, example "totalQoutedAmount" currency field, on the Opportunity Entity that is updated by summing all quote totalamounts related to that Opportunity. So I need to sum all the totaAmount fields on the Quotes related to a particular Opporunity and display that sum on a custom field called TotalQuotedAmount on the Opportunity. Any ideas and code samples would be appreciated. Thanks

    Thursday, July 31, 2014 4:06 PM

Answers

  • Use a Query expression to retrieve all Quotes that are related to Opportunity.  Make sure to grab totalAmount from the Quote.  After you've retrieved the Quotes, use a foreach loop to go through each Quote record and add the totalAmount value to some sort of int variable.

    Check the SDK for more information and sample code for Query Expressions

    • Proposed as answer by Karishma Harjani Friday, August 1, 2014 8:22 AM
    • Marked as answer by valCrmDev2 Friday, August 1, 2014 7:19 PM
    Thursday, July 31, 2014 8:41 PM

All replies

  • Use a Query expression to retrieve all Quotes that are related to Opportunity.  Make sure to grab totalAmount from the Quote.  After you've retrieved the Quotes, use a foreach loop to go through each Quote record and add the totalAmount value to some sort of int variable.

    Check the SDK for more information and sample code for Query Expressions

    • Proposed as answer by Karishma Harjani Friday, August 1, 2014 8:22 AM
    • Marked as answer by valCrmDev2 Friday, August 1, 2014 7:19 PM
    Thursday, July 31, 2014 8:41 PM
  • Thank you Zabbyzt.
    • Marked as answer by valCrmDev2 Friday, August 1, 2014 7:19 PM
    • Unmarked as answer by valCrmDev2 Friday, August 1, 2014 7:19 PM
    Friday, August 1, 2014 7:19 PM