Documentation

Update

bool
CTasks::Update(
  ID,
 array arFields
);

This method modifies parameters for the task with ID.

Method parameters

Parameter Description
ID ID of modified task
arFields Array("field"=>"value", ...). Contains values of all task fields. Required fields must be filled.

Returned value

This method returns true, if the update was sucessful; if error occurs, the method will return false. Exceptions will contain the text of the error when it occurs.

Examples of use

<?
if (CModule::IncludeModule("tasks"))
{
$arFields = Array(
"TITLE" => "New task title",
"DESCRIPTION" => "New description"
);

$ID = 1;

$obTask = new CTasks;
$success = $obTask->Update($ID, $arFields);

if($success)
{
echo "Ok!";

}
else
{
if($e = $APPLICATION->GetException())
echo "Error: ".$e->GetString();
}

}?>


© «Bitrix24», 2001-2024