How to add a field highload unit in Bitrix?

Using the Bitrix API added new HighLoad block, as you can add the name of the new field for him?

The following code complains that the fields UF_NAME not in the HighLoad unit.

\Bitrix\Main\Loader::IncludeModule('highloadblock');
 $data = array(
 'NAME' => 'Statuses',
 'TABLE_NAME' => 'ib_statuses'
 ); 
 $result = \Bitrix\Highloadblock\HighloadBlockTable::add($data);

 if ($result->isSuccess()) {

 $HLBId = $result->getId();

 $hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getById( $HLBId )->fetch(); // get the object HL unit
 $entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity( $hlblock ); // get the working entity
 $entity_data_class = $entity->getDataClass(); // get an instance of the class
 $entity_table_name = $hlblock['TABLE_NAME']; // assign a variable name HL table
 $sTableID = 'tbl_'.$entity_table_name; // add the prefix and eventually formed the name

 $arData = Array(
 0 => Array(
 'UF_NAME' => 'New'
),
 1 => Array(
 'UF_NAME' => 'On examination'
),
 2 => Array(
 'UF_NAME' => 'the author on completion'
),
 3 => Array(
 'UF_NAME' => 'IN implementation'
)
);
 foreach ($arData as $item){
 $result = $entity_data_class::add($item);
}
 }
July 8th 19 at 11:44
2 answers
July 8th 19 at 11:46
Solution
https://www.olegpro.ru/post/skripty_migraciy_dlya_... an example of creating a hl-block, as well fields for him
July 8th 19 at 11:48

Find more questions by tags 1C-Bitrix