Complex rule settings can be easily specified: - RuleObjectExists, applied to the ComplexValidationSettingsObject class. This rule is inverted. It's broken when objects with the same FirstName and LastName property values exist. So, a custom text is set for MessageTemplateMustExist to be written in the Validation Error winodw. To list the found objects, the FoundObjectMessageFormat is specified and a custom separator is set for FoundObjectMessagesSeparator. - RuleIsReferenced, applied the ComplexValidationSettingsObject class. This rule is inverted to be broken when there are objects that reference the current object. So, a custom text is set for MessageTemplateMustExist to be written in the Validation Error window. To list the found objects, the FoundObjectMessageFormat is specified and a custom separator is set for FoundObjectMessagesSeparator. The RuleObjectExists rule is checked, when saving an object; the RuleIsReferenced is checked, when deleting an object.
|