Integration::getLeadsByForm

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Integration
  4. getLeadsByForm
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/webform/options/integration.php
  • Класс: Bitrix\Crm\WebForm\Options\Integration
  • Вызов: Integration::getLeadsByForm
protected function getLeadsByForm(string $type, string $accountId, string $formId): Result
{
	$result = new Result();

	if (!$service = $this->getService())
	{
		$result->addError(
			new Error(Loc::getMessage('CRM_WEBFORM_OPTIONS_LINK_MODULE_SEO_NOT_INSTALLED'))
		);

		return $result;
	}

	$form = $service->getForm($type);
	$form->setAccountId($accountId);

	$loadLeadsResult = $form->loadLeads($formId);
	if (!$loadLeadsResult->isSuccess())
	{
		$result->addErrors($loadLeadsResult->getErrors());
		return $result;
	}

	return $loadLeadsResult;
}

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