If you want to select a category for a record, you can use the addCategory() method from the object's model class. The following code sets External, with a tree position of CONT_EXTE, as a category for a contact:
contact.addCategory("CONT_EXTE"); |
If you want to deselect a category from a record, you can use the removeCategory() method from the object's model class. The following code removes External from the list of selected categories for a contact:
contact.removeCategory("CONT_EXTE"); |
For a sample, see Updating Added Categories.