• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entityrequisite.php
  • Класс: Bitrix\Crm\EntityRequisite
  • Вызов: EntityRequisite::deleteUserField
public function deleteUserField($ufId, $checkExist = true)
{
	$ufId = (int)$ufId;
	if ($ufId <= 0)
	{
		return false;
	}

	if ($checkExist)
	{
		$userType  = new \CUserTypeEntity;
		$res = $userType->GetList(array(), array('ENTITY_ID' => $this->getUfId(), 'ID' => $ufId));
		if (!(is_object($res) && $res->Fetch()))
		{
			return false;
		}
	}

	$userField = new \CUserTypeEntity();

	$res = $userField->Delete($ufId);

	return (bool)$res;
}