|
Many custom development projects for Novell GroupWise require dealing with "custom fields". GroupWise is based on a database, and has the ability to allow developers to define their own fields, in addition to the default GroupWise data fields, to store data that is meaningful and useful to their application. This article shows how to create and manage custom fields using the GWSOAP (a.k.a. Web Services) API.
There are two steps to using custom fields: - Define the field
- Create field instances
Define the fieldYou must give the field a name, and specify the type of data it can hold. You may optionally specify restrictions on its data - for instance, you can specify a minimum and maximum value for number fields, and a maximum length for string fields. Note that field definitions exist in a post office. If you define a field in one PO, that doesn't mean that definition exists and is usable in another PO. You must define the field in each PO Note also that field definitions are a bit like function/method signatures. In many development languages, two different methods or functions can have the same NAME, as long as they have different SIGNATURES - that is, if the two like-named methods take different arguments, and/or return different data types. With GW custom fields, two different field definitions can have the same name, as long as they are of different data types.
However, for obvious reasons, it is not recommended that you do this. Give each definition a unique name. Instantiate (create) the field on an item Unlike many other database technologies, just because a GroupWise post office knows about a field definition, doesn't mean that all of the items in that PO (or in mailboxes in that PO) HAVE that field. In most DB platforms, you can access any field on any record. If there is no value for that field on that record, then you will get back a null, nil, empty string, 0, or other default value. With GroupWise, however, trying to access a field on an item that doesn't HAVE an instance of that field will produce an exception.
When you create a custom field instance for an item in GroupWise, you must specify the field definition that you intend to create. As noted above, field definitions are identified both by their name, AND their data type.
Custom field instances can exist on multiple item types in GroupWise:
- Mailbox messages
- Personal address book items
- Mailbox folders
Types of Operations
There are three types of operations you will want to perform with custom field DEFINITIONS in GroupWise: - Create field definitions
- Modify field definitions
- Delete field definitionsThese will be covered below.
There are three types of operations you will want to do with custom field INSTANCES in GroupWise (after the custom field definition has been created): - Create instances of custom fields
- Modify values of custom field instances
- Delete instances of custom fields
|