Difference between revisions of "UpdateTask"
From LongJump Support Wiki
imported>Aeric m (Text replace - 'updateTask(' to 'Functions.updateTask(') |
imported>Aeric m (Text replace - ' getEnv(' to ' Functions.getEnv(') |
||
Line 28: | Line 28: | ||
// Some code to populate the taskID. | // Some code to populate the taskID. | ||
Parameters params = Functions.getParametersInstance(); | Parameters params = Functions.getParametersInstance(); | ||
params.add("ownerID", getEnv(ENV.USER.ID)); | params.add("ownerID", Functions.getEnv(ENV.USER.ID)); | ||
// Change the owner of this task to you. | // Change the owner of this task to you. | ||
Result updateTaskResult = Functions.updateTask(taskID, params); | Result updateTaskResult = Functions.updateTask(taskID, params); |
Revision as of 21:44, 14 October 2011
- 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
- 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);