updateTask

From LongJump Support Wiki
Revision as of 21:44, 14 October 2011 by imported>Aeric (Text replace - ' getEnv(' to ' Functions.getEnv(')
Functions.updateTask(String taskId, Parameters params)
Updates a task with values in params.

Updates a task in the database. In order to update an existing task, pass the record ID of the task to Functions.updateTask() API.

Retrieve the ID of the task to be updated using the getID() method of Result class or Functions.searchRecords()API.

Syntax

Result = Functions.updateTask(String taskID, Parameters params)

Parameters

taskID
The identifier of the task
params
Field-value pairs to update in the task

Return

Result object

Example
This example creates an instance of Parameters, adds a key to it, and then calls updateTask.
String taskID = "";
// Some code to populate the taskID.
Parameters params = Functions.getParametersInstance();
params.add("ownerID", Functions.getEnv(ENV.USER.ID));
// Change the owner of this task to you.
Result updateTaskResult = Functions.updateTask(taskID, params);