Show/Hide Toolbars

Updating an involved is similar to updating other record types, such as contacts, except that you will be updating only the involved record's categories, custom field values, or clearing existing property values. You need to use the InvolvedRepository's updateInvolved method. Before you can start, you need to know the target record's unique key.

Code Snippet

private InvolvedRepository involvedRepository;

Date date = new Date();

InvolvedUpdate involved = new InvolvedUpdate();

Category cat = new Category();

//the next two lines identify a category and then add the category to the involved record

cat.setUniqueKey("INPA_ARBI");

involved.getCategories().add(cat);

Category cat2 = new Category();

involved.getCategories().add(cat2);

cat2.setUniqueKey("INPA_MEDI");

//the next four lines create a placeholder for an existing DateTime custom field, identify the known custom field name (InactiveDateDI), set the custom field value, and add the custom field placeholder to its parent category

DateTimeCustomField dateTime1 = new DateTimeCustomField();

dateTime1.setFieldName("InactiveDateDI");

dateTime1.setValue(date);

cat2.getDateTimeCustomFields().add(dateTime1);

DateTimeCustomField dateTime2 = new DateTimeCustomField();

dateTime2.setFieldName("InvolvementDateDI");

dateTime2.setValue(date);

cat2.getDateTimeCustomFields().add(dateTime2);

involvedRepository.updateInvolved(involved);