E
E
eternalfire2017-09-28 13:43:07
1C-Bitrix
eternalfire, 2017-09-28 13:43:07

How to display the highload information of the 1c Bitrix block?

How to use the external code 1 (in the picture) to display the name 2
joxi.ru/E2pbyXcB8w9nrY

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2017-09-28
@eternalfire

\Bitrix\Main\Loader::IncludeModule("highloadblock");

$xmlID = '21XlirMU'; //подставьте нужный вам внешний код        
$tblName = 'years';
$select = ['UF_NAME']; // или как у вас поле называется
$filter = ['UF_XML_ID'=>$xmlID];
$limit = 1;


$hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(
            array("filter" => array('TABLE_NAME' => $tblName))
        )->fetch();
        $entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hlblock);
        $Query = new \Bitrix\Main\Entity\Query($entity);

        $Query->setSelect($select);
        $Query->setFilter($filter);
        $Query->setOrder([]);
        $Query->setLimit($limit);

        $result = $Query->exec();

        $arResult = new \CDBResult($result);

L
latishew, 2017-09-28
@latishew

CModule::IncludeModule("highloadblock");
$hldata = Bitrix\Highloadblock\HighloadBlockTable::getById($Highloadblock_id)->fetch();
$hlentity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hldata);
$hlDataClass = $hldata["NAME"]."Table";

$result = $hlDataClass::getList(array(
        "select" => array("UF_NAME"),
        "order" => array(),
        "filter" => array("UF_XML_ID"=>$xmlID),
        ));

        while($res = $result->fetch())
        {    
            $tital[] = $res["UF_NAME"];
         }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question