CCrmFields::AddField

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmFields
  4. AddField
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_fields.php
  • Класс: \CCrmFields
  • Вызов: CCrmFields::AddField
public function AddField($arField)
{
	$obUserField = new CUserTypeEntity();
	$ID = $obUserField->Add($arField);
	$res = $ID > 0;

	if ($res)
	{
		if ($arField['USER_TYPE_ID'] == 'enumeration' && is_array($arField['LIST']))
		{
			$obEnum = new CUserFieldEnum();
			$res = $obEnum->SetEnumValues($ID, $arField['LIST']);
			if (!$res)
			{
				$ex = $GLOBALS["APPLICATION"]->GetException();
			}

		}

		$this->cUFM->CleanCache();
		$this->arUFList = $this->GetUserFields($this->sUFEntityID, 0, LANGUAGE_ID);

		UserFieldHistory::processCreation(CCrmOwnerType::ResolveIDByUFEntityID($this->sUFEntityID), $ID);
	}
	else
	{
		$ex = $GLOBALS["APPLICATION"]->GetException();

	}

	return $res;
}

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