P
P
Pavel Sidorov2020-08-03 12:12:35
1C-Bitrix
Pavel Sidorov, 2020-08-03 12:12:35

How to get the last added element to the infoblock?

Good, in fact, how to get the last added element to the infoblock using the bitrkis api?

$arFilter = Array("IBLOCK_ID"=>10);
          $res = CIBlockElement::GetList(Array(), $arFilter);
          if ($ob = $res->GetNextElement())
            {
            $arFields = $ob->GetFields(); // поля элемента
            //echo "<pre>";
            //var_dump($arFields);
            //echo "</pre>";
             }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2020-08-03
@pavel__sidorov

CIBlockElement::GetList(Array("ID" => "DESC"), $arFilter, false, array("nTopCount" => 1))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question