Answer the question
In order to leave comments, you need to log in
How to render custom field with binding type to highloadblock?
Good afternoon! Tell me how to display a custom field with the type binding to hlblock?
There is a user with a "position" field.
Данным кодом я вывожу список значений в форме.
<div class="form-group row">
<label class="col-sm-4 col-form-label">
<?=$arResult["USER_PROPERTIES"]["DATA"]["UF_POSITION_USER"]["EDIT_FORM_LABEL"]?>
<?if ($arResult["USER_PROPERTIES"]["DATA"]["UF_POSITION_USER"]["MANDATORY"]=="Y"):?>
<span class="starrequired">*</span>
<?endif;?>
</label>
<div class="col-sm-8">
<?$APPLICATION->IncludeComponent(
"bitrix:system.field.edit",
"custom-hlblock",
array("bVarsFromForm" => $arResult["bVarsFromForm"], "arUserField" => $arResult["USER_PROPERTIES"]["DATA"]["UF_POSITION_USER"]), null, array("HIDE_ICONS"=>"Y"));?>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
In theory, when reading a section, it stores the record ID of the highload block.
According to it, you need to get the field that stores the title of the position.
It's not visible on the screenshot, let's assume it is stored in UF_NAME .
If the selection contains a reference, it is possible that the position has already been pulled up through it and you can reach UF_NAME .
If not, read it yourself and display it, and so that a request to the database is not sent every time, cache the component.
If there is a need (many places where a position is needed), it would be nice to organize it in such a way that a separate cache is stored in the system that stores all positions associated with an ID (an array of the form
[1] => [ "UF_NAME" => "Лаборант-исследователь",
[2] => [ "UF_NAME" => "Стажер-исследователь",
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question