Update
bool CTaskTemplates::Update( ID, array arFields, array arParams = array() );
The method updates parameters for template with ID.
Method parameters
Parameter | Description | Available from version |
---|---|---|
ID | Id of the updated template. | |
arFields | Array("field"=>"value", ...). Contains values of all template fields. Required fields must be filled out. | |
arParams | Array of additional parameters. Optional. |
Returned value
The method returns true, if the update was successful. When an error occurs, the method will return false and exceptions will contain the text of error.
Examples of use
<?
if (CModule::IncludeModule("tasks"))
{
$arFields = Array(
"TITLE" => "New task title",
"DESCRIPTION" => "New description"
);
$ID = 1;
$obTemplate = new CTaskTemplates;
$success = $obTemplate->Update($ID, $arFields);
if($success)
{
echo "Ok!";
}
else
{
if($e = $APPLICATION->GetException())
echo "Error: ".$e->GetString();
}
}?>
© «Bitrix24», 2001-2024