• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Operation/Update.php
  • Класс: Bitrix\Crm\Service\Operation\Update
  • Вызов: Update::autocompleteActivities
protected function autocompleteActivities(): Result
{
	if ($this->wasItemMovedToFinalStage() && !empty($this->getActivityProvidersToAutocomplete()))
	{
		$authorId = $this->getContext()->getUserId();
		if ($authorId <= 0)
		{
			$authorId = $this->getItem()->getUpdatedBy();
		}

		\CCrmActivity::SetAutoCompletedByOwner(
			$this->getItem()->getEntityTypeId(),
			$this->getItem()->getId(),
			$this->getActivityProvidersToAutocomplete(),
			['CURRENT_USER' => $authorId]
		);
	}

	return new Result();
}