Discussion
Pegasystems Inc.
PL
Last activity: 2 Apr 2015 3:25 EDT
Validating Data Elements Quiz question
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi Juan,
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.
Hope this helps.
Regards,
Henry
Pega Academy
Pegasystems Inc.
PL
Hi Henry,
Wouldn't make more sense to use Property > Advanced > Validation > Max Length + Validation Rule?
Thanks and regards,
Juan Cortines
Pegasystems Inc.
PL
Also, I've noticed some Edit Validate rules are evaluated on the client side without submitting data to the backend, either submit or ajax. That's the case in ValidEmailAddress
However, some other Edit Validate rules are not evaluated until the form is submitted. That's the case of IsValidOperatorID
Does PRPC auto-generate JavaScript based on the Java code and perform client-side validation when possible? OR, client-side Edit Validation rules require some special configuration?
Thanks!
Pegasystems Inc.
US
Juan,
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.
eddie
Pegasystems Inc.
US
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.
eddie
Pegasystems Inc.
PL
Thanks Eddie. That's a valuable input.
What if I really needed a custom Edit Validate rule to be evaluated before submitting a form (as in ValidEmailAddress)? Is it possible or only certain built-in Edit Validate rules have that feature?
Thanks
Pegasystems Inc.
US
Hi Cortj,
Only selected OOTB Edit Validate Rules have the built in feature that tacks on automatic Client Side Validation.
Regards,
Henry
Pega Academy
Pegasystems Inc.
PL
Thanks, now it all makes sense.
Juan