ResultEntity::addLead

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ResultEntity
  4. addLead
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/webform/resultentity.php
  • Класс: Bitrix\Crm\WebForm\ResultEntity
  • Вызов: ResultEntity::addLead
protected function addLead($leadParams = array())
{
	$this->addClient();

	$params = [
		'SET_PRODUCTS' => true
	];

	if ($this->companyId)
	{
		$params['FIELDS']['COMPANY_ID'] = $this->companyId;
	}

	if ($this->contactId)
	{
		$params['FIELDS']['CONTACT_ID'] = $this->contactId;
	}

	if ($this->leadId = $this->addByEntityName(\CCrmOwnerType::LeadName, $params))
	{
		WebFormTracker::getInstance()->registerLead($this->leadId, array('ORIGIN_ID' => $this->formId));
	}

	if ($leadParams['ADD_INVOICE'])
	{
		$this->addInvoice();
	}
}

Добавить комментарий