3.47 FieldDefinitions

Contains the FieldDefinition objects for an Account, AddressBook, or DocumentLibrary. The root Account and each AddressBook have independent collections. The root Account collection includes user-defined fields that can appear in its messages. An AddressBook collection includes user-defined and predefined fields that can appear in its entries.

3.47.1 Properties

The following table lists properties along with their access and descriptions.

Property

Access

Description

Application

R/O

Application. The Application object.

Count

R/O

Long. The number of objects in this collection.

_NewEnum

R/O

Enumeration object. Implements IEnumVARIANT. For Windows only.

Parent

R/O

Object. The Account, AddressBook, or DocumentLibrary object that owns this collection.

3.47.2 Methods

FieldDefinition Add(String Name, FieldTypeConstants FieldType)

Defines a field with the given Name and FieldType. See FieldTypeConstants. Throws an exception when the owning Account or AddressBook has a FieldDefinition object that includes the same Name and FieldType. You cannot add FieldDefinition objects to a document library with this method.

FieldDefinition Item(String FieldName, FieldTypeConstants FieldType)

DEFAULT. Returns the FieldDefinition object with the given of FieldName and FieldType. See FieldTypeConstants.

FieldDefinition Item(Long Index)

DEFAULT. Returns the FieldDefinition object located at the given Index in the collection. Valid indexes are 1 through Count. Throws an exception when Index is outside of this range.

3.47.3 Remarks

The Item method template is as follows:

Item(VARIANT P1, [VARIANT P2]).

The Item method checks the P1 type at runtime.

  • If P1 is an string, the first form of Item is assumed; P2 must be a FieldType of type FieldTypeConstants.

  • If P1 is a Long, the second form of Item is assumed; P2 is ignored.

A FieldDefinitions collection is refreshed when its parent object is refreshed. When a FieldDefinitions collection is refreshed, it recursively refreshes its contained FieldDefinition objects.