Difference between revisions of "UpdateTask"
From LongJump Support Wiki
imported>Aeric m (Text replace - 'updateTask(' to 'Functions.updateTask(') |
imported>Aeric |
||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
'''Syntax''' | '''Syntax''' | ||
< | :<syntaxhighlight lang="java" enclose="div"> | ||
Result = Functions.updateTask(String taskID, Parameters params) | |||
</syntaxhighlight> | |||
'''Parameters''' | '''Parameters''' | ||
Line 17: | Line 19: | ||
'''Return''' | '''Return''' | ||
:[[Result Class|<tt>Result</tt> object]] | |||
[[Result Class|<tt>Result</tt> object]] | |||
;Example:This example creates an instance of <tt>Parameters</tt>, adds a key to it, and then calls <tt>updateTask</tt>. | ;Example:This example creates an instance of <tt>Parameters</tt>, adds a key to it, and then calls <tt>updateTask</tt>. | ||
Line 28: | Line 29: | ||
// 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); |
Latest revision as of 00:28, 14 December 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);