Documentation

OnDocumentDelete

void
public static function CBPDocument::OnDocumentDelete(
 array documentId,
 array &arErrors
);

This method deletes all workflow module records, associated with a document.

Method parameters

ParameterDescription
documentIdDocument ID code as an array(module, document_class, document_code_in_module)
arErrorsArray of errors which occurred during deletion; presented as
array(
array(
"code" => code_error,
"message" => message,
"file" => path_to_file
),
...
)

Examples

<?
$arState = CBPStateService::GetWorkflowState($deleteWorkflowId);
if (count($arState) > 0)
{
$arErrorsTmp = array();
CBPDocument::OnDocumentDelete($arState["DOCUMENT_ID"], $arErrorsTmp);
if (count($arErrorsTmp) > 0)
{
foreach ($arErrorsTmp as $e)
$errorMessage .= $e["message"].". ";
}
}
?>


© «Bitrix24», 2001-2024
Up