A
A
Andrey Sobolev2020-07-22 14:25:39
1C-Bitrix
Andrey Sobolev, 2020-07-22 14:25:39

How to extract all infoblock elements by infoblock property?

I have an infoblock

5f1821d62638d854850473.png

. It has a GROUP_TENDERS property, which is a binding to autocomplete elements. How can I pull out all the elements of the infoblock, with an attached element, for example, whose ID is equal to ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-07-22
@andrufka46rus

$iblockID = 1; // ID инфоблока
$groupTendersID = 2; // ID привязанного элемента
$filter = ['IBLOCK_ID' => $iblockId, 'PROPERTY_49' => $groupTendersID]
$result = CIblockElement::GetList([], $filter, false, false, ['ID', 'IBLOCK_ID', 'NAME']);
while ($arElement = $result->GetNext()) {
    echo $arElement['NAME'];
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question