I have a Roll-Up Summary (SUM Opportunity Product) field. The field gives an option to Only records meeting certain criteria should be included in the calculation
which is really good because it allows me to filter but the filter criteria only has AND
option but not an OR
. Why is that? And how can I workaround it? Please assist.
2 Answers
There's a couple of ways to work around this limitation.
One option, using native functionality, is to decompose your OR
Roll-Up Summary into more than one Roll-Up Summary, each of which has only a single criterion, and then using a separate formula field to sum those component Roll-Up Summaries. The downside to this approach, of course, is that you consume more of your scarce limit for Roll-Up Summaries.
Another option would be to use Declarative Lookup Rollup Summaries, which (belying its name) can also work on master-detail relationships and which supports the full breadth of SOQL in defining the set of records to be included in the rollup.
-
1DLRS is exactly what I recommend whenever you need something more complicated than the out-of-the-box feature, which is pretty common given its limitations.– sfdcfoxMay 7, 2018 at 19:50
-
1Same here - unfortunately some orgs are extremely reluctant to install packages and/or are in Apex limit trouble.– David Reed ♦May 7, 2018 at 19:56
myFormula__c = true