A
A
Anatoly Tsybin2021-01-26 15:34:25
1C-Bitrix
Anatoly Tsybin, 2021-01-26 15:34:25

How to change the data type of a field in an existing HighloadBlock bitrix?

The data type in HighloadBlock can only be set for the new field.
I need to change the field type from int to string.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
PetrPo, 2021-01-26
@Tsybinn

Apparently, the most correct solution would be to write a script in which
1. Collect all the values ​​of this field
2. Create a new field
3. Fill in the new field with values
​​4. Delete the old field
Why so, because the block hl field = user field, and CUserTypeEntity ::Update starts with

unset($arFields["ENTITY_ID"]);
unset($arFields["FIELD_NAME"]);
unset($arFields["USER_TYPE_ID"]);
unset($arFields["MULTIPLE"]);

Those. bitrixoids do not require changing the USER_TYPE_ID field in their api

A
Alexey Emelyanov, 2021-01-26
@babarun

Change USER_TYPE_ID in the corresponding b_user_field
60101336167cd475284049.png
Then change the field type of the corresponding field in the table
601013ca1ee6e232340561.png
Just keep in mind that the data inside this "column" will be lost

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question