Show/Hide Toolbars

The following sample updates a task record with the actual hours to complete the task, a newly calculated total amount, the date the task was completed, and percent completion value.

Code Snippet

//for this sample, it is assumed that a task record already exists with a unique key String equal to uniqueKey

protected TaskRepository taskRepository;

public void test_updateTask() throws Exception {

Date date = new Date();

TaskUpdate taskUpdate = new TaskUpdate();

//use the setUniqueKey method to identify the target task record to update by its unique key

taskUpdate.setUniqueKey(uniqueKey);

taskUpdate.setActualHours(new BigDecimal("15.00"));

taskUpdate.setRateAmount(new BigDecimal("50"));

taskUpdate.setCompletedDate(date);

taskUpdate.setCompletedPercent(100.00);

taskRepository.updateTask(taskUpdate);

}