Closed jsteve06 closed 1 year ago
@jsteve06 you have a few options:
RollupSObjectUpdater
(see the example in the README for more info on that)RollupSettings__c
in your validation rules; you would need to update the IsEnabled__c
flag as is appropriate in order for this to work as the VR bypassLet me know if either of those approaches would work, or if you were thinking of something else. Thanks!
@jamessimone Well I am not a developer so option one is out :)
Option 2 would work but I can't get it to work. If I reference it in the validation rule at either the org default or profile level, it is always on or off. So either I say AND(ISPICKVAL(Activec,''), $Setup.RollupSettingsc.IsEnabled__c = true ) and the validation rule still fires, or I set it to false and the validation rule works but is not bypassed when the rollup occurs.
In my ideal world there would be another custom setting like "Bypass Validation Rule". That custom setting would be referenced in the validation rules. When the rollup updates the record the setting would return 'true' otherwise it would return false. So then you'd just add $Setup.RollupSettings__c.Bypass_Validation_Rule = false to your validation rules. Hopefully that makes sense.
@jsteve06 thanks for the additional context. I should be able to add another custom setting for this soon
That would be great. Validation rules are the bane of my existence :)
@jsteve06 #441 added support for this - check the Rollup Plugins
section of the README, or the release notes for more info!
This is awesome @jamessimone! I have it setup and working in my Dev org. Took me a minute to figure out I needed to add a record to the Custom Meta Data rollup Plugin Parameter. Once I got that sorted out it worked like a charm.
Thanks so much for adding this functionality.
No problem - couldn't have done it without you suggesting it! Thanks for making open source better by raising an issue and providing me with an excellent summary of what you were looking to do.
Is there a way to have the rollups bypass validation rules on the parent object? The product Rollup Helper has a custom setting that you can reference in the validation rule so that the rule is invalid when it updates the record. A lot of orgs that I work on have tons of validation rules so bypassing them to allow the rollups to work is crucial.