1

I'm having at a loss here though I believe I might just be missing something about the behavior of Validation Rules.

So the situation is like this:

1 - I have 4 Custom Objects (ObjA, ObjBLineItem, ObjC, ObjD).

ObjA has Master-Detail Relationship with ObjBLineItem ObjBLineItem has Master-Detail Relationship with ObjC ObjC has a Lookup relationship with ObjD

ObjA -MD-> ObjBLineItem -MD-> ObjC -LU-> ObjD

2 - I've created a Process Flow in ObjA that will set a Flag in ObjD to True if conditions are met when ObjA is edited.

This Flag will be used by ObjC

3 - I've created a Validation Rule that will check if Flag is True or False. If True, then ObjC cannot be edited. IF False, then ObjC can be edited.

Problem

When the Process Flow in ObjA is fired, I somehow get the error of the Validation Rule.

I'm confused because during the run of the Process Flow, ObjC was not edited or even touched at all so why did the Validation Rule fire?

I initially thought that a Trigger in ObjA must be updating ObjC but I can't find any triggers at all.

Any help will be very much appreciated.

Thanks.

0

1 Answer 1

2

This happens when a child record is updated and there is a rollup-summary on the parent.

An update to the child will cause the parent to also update:

A roll-up summary field can trigger workflow rules and field validations. However, workflow rules and field validations do not fire when the following changes cause a mass recalculation of roll-up summary values:

  • Changing the roll-up summary definition (such as the object, function, or field being aggregated)
  • Changing the expression of a formula field referenced in a roll-up summary field Replacing picklist values for picklist fields referenced in the roll-up summary filter
  • Changing picklist record type definitions
  • Changing currency conversion rates
  • Changing price book entries

https://help.salesforce.com/articleView?id=fields_about_roll_up_summary_fields.htm&language=en&type=0

An additional note, when you put validation rules in place it is a good practice to update existing records to meet the new criteria so you do not run into these problems. Although it may not be relevant in your case it is a good practice to follow.

1
  • Wow yes. This actually confirms my suspicion. Thanks sir! Now I just need to figure out how to circumvent this issue. Perhaps you may have any solutions to this? Btw, I owe you beer. Cheers! Apr 4, 2017 at 4:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .