CreateDocument
mixed
IBPWorkflowDocument::CreateDocument( mixed pid,
array arFields
);
This method creates new document with specified properties (fields) and returns its ID code.
Method parameters
Parameter | Description |
---|---|
pid | Not used |
arFields | Array of document property values in the form of
array(Property code correspond to property codes, returned by the GetDocumentFields method. |
Examples
<?
public function CreateDocument($pid, $arFields)
{
$iblockElement = new CIBlockElement();
$id = $iblockElement->Add($arFields);
if (!$id || $id <= 0)
throw new Exception($iblockElement->LAST_ERROR);
return $id;
}
?>
© «Bitrix24», 2001-2024