N
N
Nikolai2018-06-25 17:18:11
1C-Bitrix
Nikolai, 2018-06-25 17:18:11

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.5b30f99f321d4289485906.png

Данным кодом я вывожу список значений в форме.
<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>

But how can I display a purely single value that was assigned to the user?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Burlaka, 2018-06-25
@AlexeyGfi

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" => "Стажер-исследователь",

). And then simply by the record code, from any place in the project, a position would be received. And so that this cache is stored “forever”, and frayed only if a highloadblock entry is added / edited / deleted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question