• Модуль: rpa
  • Путь к файлу: ~/bitrix/modules/rpa/lib/integration/bizproc/document/item.php
  • Класс: BitrixRpaIntegrationBizprocDocumentItem
  • Вызов: Item::deleteDocument
static function deleteDocument($documentId)
{
	[$typeId, $itemId] = explode(':', $documentId);

	$type = TypeTable::getById($typeId)->fetchObject();

	if (!$type)
	{
		return false;
	}

	$item = $type->getItem($itemId);

	if(!$item)
	{
		return false;
	}

	$command = Driver::getInstance()->getFactory()->getDeleteCommand($item);

	$command->setScope(ItemHistoryTable::SCOPE_AUTOMATION);
	$command->disableCheckAccess();
	$command->setUserId(0);

	$result = $command->run();

	return $result->isSuccess();
}