Could sobody please explain in detail the correct answer to this question?
We have the following requirement: The user name entered must not already be taken and it should not exceed 10 characters. Which one of the following choices is the best way to address this requirement? (Choose One)
An edit validate rule that verifies both these conditions
A single validate rule to verify both these conditions
A validate rule for the first condition which calls another validate rule which has the second condition since the validate rule cannot specify different conditions for the same field
A validate rule for the first condition and an edit validate for the second
The best answer is the second option, "A single validate rule to verify both these conditions". The reason is that it is the easiest and simplest of all the approaches presented.
We could create an Edit Validate rule that accomplishes both but that would require writing a lot of custom java which violates two Pega Best Practices. 1. Do nothing that is hard. 2. Avoid custom java.
The third option is invalid, because we can specify different conditions for the same field. In fact we can even reference the same field (property) multiple times in the same Validate rule.
We could create a Validate rule for the first condition and Edit validate rule for the second but that would be unnecessarily complicated and it would again violate two Pega Best Practices. 1. Do nothing that is hard. 2. Avoid custom java.
I've always found that question interesting for the same reasons you do.
Yes, you could use Max Length (and most would argue that is the best practice to enforce that type of constraint). But, if the options presented in the quiz are all that we are given to enforce this type of constraint, we have to pick the best from that list.
As to the question regarding the need for special configuration to use Edit Validate rules, Pega 7 takes care of the heavy lifting. If Pega provides an Edit Validate record, it has all the functionality it needs to be useful as-is.