• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/automation/target/ordertarget.php
  • Класс: Bitrix\Crm\Automation\Target\OrderTarget
  • Вызов: OrderTarget::setEntityStatus
public function setEntityStatus($statusId, $executeBy = null)
{
	$id = $this->getEntityId();
	$oldStatus = $this->getEntityStatus();
	$this->setEntityField('STATUS_ID', $oldStatus);

	$result = Order\Manager::setOrderStatus($id, $statusId, Loc::getMessage('CRM_AUTOMATION_TARGET_ORDER_TRIGGER_APPLY'));
	if (!$result->isSuccess())
	{
		return false;
	}

	return true;
}