1.5 Custom Fields on GroupWise Items

If you want to add application-specific data to items in the GroupWise store, you can do this with custom fields. For example, if application X wanted to track the items it created in a user’s data store, application X could add a custom field with a value of X to all items it creates. Later, the application can use filters to find application X's items.

When a custom field is added to an item, the new custom field definition is added to the GroupWise post office database. If the post office database has too many custom fields, POA performance can be reduced. We recommend that the number of custom fields be kept to a minimum and that applications use no more than two or three custom fields.

To list the custom field definitions on a post office, call getCustomListRequest, which returns the list of custom fields without any associated values.

To remove a custom field definition in the post office database, call removeCustomDefinitionRequest. Because the custom field needs to be removed from the items before the definition can be removed from the post office guardian database, this method can take some time to process.

You can add a custom fields to new or existing items, You can also modify existing custom fields. Custom fields can be string, date, numeric, or binary data.

To create custom fields on new items, you need to specify the custom fields in the sendItemRequest (or createItemRequest) as in the following example:

<ns0:sendItemRequest>
<ns0:item xmlns:ans1="http://schemas.novell.com/2005/01/GroupWise/types"xsi:type="ans1:Mail">
<ans1:version>0</ans1:version>
<ans1:customs>
 <ans1:custom type="String">
 <ans1:field>customField1</ans1:field>
 <ans1:value>StringValue</ans1:value>
</ans1:custom>
</ans1:customs>
...

You can add a custom field to an existing posted or distributed item with the ModifyItemRequest.

<ns0:modifyItemRequest>
<ns0:id>48F60187.domain1.po1.100.16A6163.1.138B.1@1:7.domain1.po1.100.0.1.0.1@16</ns0:id>
<ns0:updates>
<ans1:update xmlns:ans1="http://schemas.novell.com/2005/01/GroupWise/types"xsi:type="ans1:Mail">
<ans1:version>0</ans1:version>
<ans1:customs>
<ans1:custom type="String">
<ans1:field>customField2</ans1:field>
<ans1:value>StringValue2</ans1:value>
</ans1:custom>
</ans1:customs>
</ans1:update>
</ns0:updates>
...
</ns0:modifyItemRequest>

You can also modify an existing custom field by passing in the name of the custom field with the new value.

<ns0:modifyItemRequest>
<ns0:id>48F60187.domain1.po1.100.16A6163.1.138B.1@1:7.domain1.po1.100.0.1.0.1@16</ns0:id>
<ns0:updates>
<ans1:update xmlns:ans1="http://schemas.novell.com/2005/01/GroupWise/types"xsi:type="ans1:Mail">
<ans1:version>0</ans1:version>
<ans1:customs>
<ans1:custom type="String">
<ans1:field>customField1</ans1:field>
<ans1:value>New String Value</ans1:value>
</ans1:custom>
</ans1:customs>
</ans1:update>
</ns0:updates>
...
</ns0:modifyItemRequest>