I have this scenario:
- Quote object has some fields that sum up values from the QuoteLineItems;
- Some updates in Quote may change the value summed up by the Quote;
- Other updates in the QuoteLineItem may change that summed up value as well;
But those fields in QuoteLineItem are some complex formulas with cross-object fields, so I can't use regular roll-up summary fields in the Quote (http://help.salesforce.com/HTViewHelpDoc?id=fields_about_roll_up_summary_fields.htm&language=en_US, cross-object formula fields limitation). So, I solved this situation by using an after update quote trigger.
Every time a Quote is updated, an after update trigger will make a query of its quote line items, sum up the desired fields and make an update on the Quote. I'm using a static boolean to control recursion.
But still there are some SOQL queries being made (and I would like to minimize that) and I'm not sure this is the best way to achieve my desired behavior, or if there is other better replacement for this scenario, such as Process Builder or Workflow. I have never used those mechanisms, so I'm not sure I should be using it or I'm already use the most appropriate approach. Any help?