Documentation

UpdateDocument

void
IBPWorkflowDocument::UpdateDocument(
 mixed documentId,
 array arFields
);

This method modifies properties (fields) of specified document to the indicated values.

Method parameters

ParameterDescription
documentIdDocument ID code
arFieldsArray of new document property values as follows
array(
code_property => value,
...
)
Property codes correspond to property codes that are returned by the GetDocumentFields method.

Examples

<?
public function UpdateDocument($documentId, $arFields)
{
$documentId = intval($documentId);
if ($documentId <= 0)
throw new CBPArgumentNullException("documentId");

$iblockElement = new CIBlockElement();
$res = $iblockElement->Update($documentId, $arFields);
if (!$res)
throw new Exception($iblockElement->LAST_ERROR);
}
?>


© «Bitrix24», 2001-2024