A
A
Aricus2022-02-25 18:01:06
1C-Bitrix
Aricus, 2022-02-25 18:01:06

Where is the error in searching for an infoblock element by a custom property in 1C-Bitrix?

I'm trying to find an infoblock element by a custom property. But the value is the same.

foreach ($docTypeElemList as $docTypeElem) {
    $thisSearchArr = [
      "IBLOCK_ID"=>$arParams['IB_DOC'],
      "ACTIVE"=>"Y",
      'IBLOCK_SECTION_ID'=>$docInnerFolder['ID'],
      'F_BOND_TYPE'=>$docTypeElem['ID'] // Пользовательское свойство
    ];
    pr($thisSearchArr); // Вывод на экран массива поиска
    $thisDocSearch = CIBlockElement::GetList($reqSort, $thisSearchArr); // Поиск
    if ($thisDocEl = $thisDocSearch->GetNextElement()) { // Получение элемента (он должен быть один
      $thisDoc = $thisDocEl->GetFields();  // Получение списка полей
      pr($thisDoc['ID']); // Вывод на экран ID найденного элемента
    }
  }

Here is what was displayed on the screen:
File: /local/components/module/catalog.documentation.cat/component.php [19]
Array
(
[IBLOCK_ID] => 4
[ACTIVE] => Y
[IBLOCK_SECTION_ID] => 37
[F_BOND_TYPE] => 50
)
File: /local/components/module/catalog.documentation.cat/component.php [23]
122
File: /local/components/module/catalog.documentation.cat/component.php [19]
Array
(
[IBLOCK_ID] => 4
[ ACTIVE] => Y
[IBLOCK_SECTION_ID] => 37
[F_BOND_TYPE] => 51
)
File: /local/components/module/catalog.documentation.cat/component.php [23]
122

Here it says that you need to check the option "Property values ​​are included in the search" in the property settings.
But there is no such option!
6218ef2597246529262115.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question