Documentation

Add

bool
CTaskDependence::Add(
 array arFields
);

This method adds previous dependent task to the specified task.

Method parameters

Parameter Description
arFields Array("field"=>"value", ...). Contains the following fields:
  • TASK_ID - task ID;
  • DEPENDS_ON_ID - previous dependant task ID.

Returned value

The method returns true, if the adding was successful. When an error occurs, the method will return false, and exception will contain errors. 

Examples of use

<?
if (CModule::IncludeModule("tasks"))
{
$arFields = Array(
"TASK_ID" => 4,
"DEPENDS_ON_ID" => 15
);

$obTaskDependence = new CTaskDependence;
$ID = $obTaskDependence->Add($arFields);
$success = ($ID>0);

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

}?>


© «Bitrix24», 2001-2024