Understanding Gosu rule actions
Within the rule ACTION block, you create the outcome
for the criteria identified in the rule CONDITION block. Actions can be
single statements or they can be strung together to fulfill multiple
criteria. You can add any number of actions to a rule.
For example, suppose that you want to verify that the country field exists on a contact’s home phone number and is valid. The following syntax creates this action:
if (contact.HomePhoneCountry == null) {
contact.rejectField("HomePhoneCountry", ValidationLevel.TC_LOADSAVE, displaykey.Validator.Phone.Home
.CountryCode.Null, null, null)
}
if (contact.HomePhoneCountry == PhoneCountryCode.TC_UNPARSEABLE) {
contact.rejectField("HomePhoneCountry", ValidationLevel.TC_LOADSAVE, displaykey.Validator.Phone.Home
.CountryCode.Unparseable, null, null)
}
See also
- See Validation for a discussion of the various reject methods.
