Validation Rules issue

Hello,

I think I found an issue with the Validation Rules processing (or at least, a grey area).

I’ve created 4 fields which should not be able to be changed if 2 of them are not set. In order to modify the 2 fields “at the same time”, I’m using a button which ask the user to fill the 4 fields.

Then, I have a Validation Rule that trigger on the 4 fields and that the Validation formula is :

IsEmpty([Step 1 DB].MandatoryFieldA) = false and IsEmpty([Step 1 DB].MandatoryFieldB) = false

Theoretically, on my Button form, when I click on Run, all my fields are changed at the same time. But it seems that the Validation Rules engine evaluate the situation right after the first field change. That’s a big limitation on my Workflow process.

Could you please review this process in order to take into account the situation of all triggered fields at the same time ?

So you need to block changes if the two fields are empty?

If so, then shouldn’t your validation rule be

IsEmpty([Step 1 DB].MandatoryFieldA) and IsEmpty([Step 1 DB].MandatoryFieldB)

?

Alternatively, if either being empty should block changes…

IsEmpty([Step 1 DB].MandatoryFieldA) or IsEmpty([Step 1 DB].MandatoryFieldB)

By the way, just wondering why use validation rules rather than making these fields required fields?

Ok, that’s correct. My logic was wrong.

What about if my Fields A and B are set and I want to :

  1. Prevent the User to change one of my 4 fields ?
  2. If the User wants to clear the 4 fields, he needs to do it from a Button ? So, when Field A and Field B are set, it should not possible to change them individually.

This fields are only required when starting a schedule process. They aren’t required for the entity creation.

When planning validation rules, I think it can be best to enumerate (or at least consider) all the possible actions that a user might attempt to take, and make a clear decision on which should be blocked and which should not.
It seem like you have 4 fields, two of which seem to be more important than the others (mandatory). So let’s call the fields M1, M2, O1 and O2 (optional fields).
Each field can go from empty to filled (E→F), filled to empty (F→E) or its value can be changed (FC) or unchanged (EUC or FUC).

Here’s an example of an action event:

M1 (E→F)
M2 (EUC)
O1 (FC)
O2 (FUC)

This notation means mandatory field 1 is being filled with a value, at the same time that optional field 1 is having its value changed. M2 remains empty and O2 keeps the same (non-empty) value.
Assuming that you can enumerate all the possibilities (and decide which should be blocked and which not) then defining the necessary validation rule(s) shouldn’t be that hard :crossed_fingers:

Note: At this stage, it doesn’t really matter whether the user is making the changes with a button or on the UI, but I can understand that you might end up defining validation rules such that a user can only do a specific desirable action via a button (i.e. an action that requires simultaneous updates to multiple fields)

Anyway, as I see it, your need is somewhat described here:

but I am uncertain of the details - it seems ambiguously worded.

“If the User wants to clear the 4 fields” - do you mean ‘if the user wants to clear any of the 4 fields’? or ‘if the user wants to clear all of the 4 fields’?

“when Field A and Field B are set, it should not possible to change them individually.” - what is ‘them’ in this sentence? Do you mean ‘it should not be possible to change either of Field A or Field B’ or ‘it should be not possible to change any of the aforementioned 4 fields’?

Anyway, maybe there’s a top level use case you could provide which might help us align on what is being worked towards… an example of what the ultimate goal is - maybe with more meaningful names that ‘mandatory field A’(!) - so that we’re in the same headspace