Code example for creating ABContact and ABCompany contacts
The following code sample from ValidateABContactCreationPluginBase shows code defining contact creation requirements for ABContact and ABCompany:
protected function abContactIsInvalid(contact : ABContact) : boolean {
return contact.Tags == null or contact.Tags.IsEmpty
}
protected function abCompanyIsInvalid(contact : ABCompany) : boolean {
if (abContactIsInvalid(contact))
return true
if (RequiresTaxID) {
return contact.Name == null
or (isLackingCompleteAddress(contact.PrimaryAddress)
and isLackingAnyPhoneNumber(contact)
and contact.TaxID == null)
} else {
return contact.Name == null
or (isLackingCompleteAddress(contact.PrimaryAddress)
and isLackingAnyPhoneNumber(contact))
}
