updateTask

From LongJump Support Wiki
Revision as of 23:38, 20 December 2010 by imported>Aeric (Text replace - 'updateTask(' to 'Functions.updateTask(')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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", getEnv(ENV.USER.ID));
// Change the owner of this task to you.
Result updateTaskResult = Functions.updateTask(taskID, params);