function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ashleysisti1.3911321512638052E12ashleysisti1.3911321512638052E12 

Need a simple trigger to roll up count of Opportunity Products based on checkbox value.

I have only 2 rollup summary fields on the Opportunity object left and need to install an AppExchange package that uses 3 roll-up summary fields. I was told a simple trigger to replace one of the rollups would work but I have no clue how to do it. I need to populate a field called "Inactive Product Count" counting the number of Opportunity Products on the Opportunity that don't have the "Active" box checked (this then feeds a validation rule not allowing users to save Opps as closed-won if the count is greater than zero). Can anyone help?
sfdc_ninjasfdc_ninja
I have used this utility that Anthony Victorio came up with many times and it works wonders.  Easy to implement.  I would take a look at this

http://www.anthonyvictorio.com/salesforce/roll-up-summary-utility/