Show/Hide Toolbars

Web Services support populating, editing, clearing, and reading custom field values.

Before You Begin

A custom field must already exist in TeamConnect before you can add the custom field to a record using Web Services. Use the TeamConnect Designer UI area to create new custom fields (for an object/category combination).

Important: Each custom field is dependent on a record category. Before you can work with a custom field in a record, its corresponding category (or category hierarchy) must be enabled in that record. For more information, see Working with Categories.

You also need to get the following information before working with categories using Web Services:

Category unique key—This value is constructed like <projectUniqueCode + "_" + categoryTreePosition>

For example, if you are adding a parent category, Contracts (with tree position "CONT") that was created under the Dispute object (with unique code "DISP"), then the category unique key would be "DISP_CONT".

Another example would be if you are adding a child category, Confidentiality Breach (with tree position "COBR"), which is a child of the Contracts category under the Dispute object, then the unique key would be "DISP_CONT_COBR".

Category name

Custom field type (for example, Boolean, DateTime, Decimal, Involved, Note, Project, Text, TableItem)

Custom field name

Populating and Updating Custom Field Values

To populate a custom field value, you would enable the corresponding category for a record. There are several type classes available to instantiate a class or container for the properties of a custom field. Each of these type classes are associated with a field data type and include: BooleanCustomField, DateTimeCustomField, DecimalCustomField, InvolvedCustomField, NoteCustomField, ProjectCustomField, TableItemCustomField, TextCustomField. Instantiate the appropriate custom field type class. Use the provided methods, setFieldName(String value) and setValue(boolean value) to identify the custom field name to populate and to assign the field value for, respectively (where the setValue parameter type would vary).

Each custom field is associated with a category. From the Category type class, several methods are provided to add the custom field data object described in the paragraph above, including getBooleanCustomFields(); getDateTimeCustomFields(); getDecimalCustomFields(); getInvolvedCustomFields(); getNoteCustomFields(); getProjectCustomFields(); getTableItemCustomFields(); getTextCustomFields().

A sample for populating a boolean custom field (associated with a corresponding category) for a record follows:

PersonCreate person = createPerson();

Category cat2 = new Category();

cat2.setUniqueKey("CONT");

BooleanCustomField synched = new BooleanCustomField();

synched.setFieldName("Synchronized");

synched.setValue(true);

cat2.getBooleanCustomFields().add(synched);

person.getCategories().add(cat2);

Use the custom field type class' setValue() method to populate or update a custom field's value.

Clearing Custom Field Values

Use the custom field type class' setValue() method to clear a custom field's value. For example:

PersonUpdate person = PersonUpdate();

Category cat2 = new Category();

cat2.setUniqueKey("CONT");

BooleanCustomField synched = new BooleanCustomField();

synched.setFieldName("Synchronized");

synched.setValue();

//in this case set the value to null to clear the current custom field value. if the custom field were a String type, you'd set the value to ""

cat2.getBooleanCustomFields().add(synched);

person.getCategories().add(cat2);

Reading Custom Field Values

When reading a record, specify the categories property as part of the return values. The resulting record's categories (property) object will also contain all associated custom fields and related custom field properties.