Skip to main content
Version: 1.34.0

SimpleColumn

Use the SimpleColumn class to convert column types and their content from Text to WYSIWYG and from WYSIWYG to Text.

convertTextToWYSIWYG(columnId)


Use this method to convert the column type from Text to WYSIWYG. The method also converts the column text content.

If the package with the data to be converted exceeds the size limit, conversion errors may occur. In this case, corresponding records are created in the Main Log (sys_log) table. They contain the IDs of the records that could not be converted. To retry the conversion for the records, use the reconvertRecords() method.

Parameter(s):

NameTypeMandatoryDefault value
columnIdStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

convertTextToWYSIWYG()
const columnId = '154931135900000013';
const column = new SimpleColumn(columnId);
column.convertTextToWYSIWYG();

convertWYSIWYGToText(columnId)


Use this method to initiate the conversion of a column from type WYSIWYG to Text. The method also converts the column data.

If the package with the data to be converted exceeds the size limit, conversion errors may occur. In this case, corresponding records are created in the Main Log (sys_log) table. They contain the IDs of the records that could not be converted. To retry the conversion for the records, use the reconvertRecords() method.

Parameter(s):

NameTypeMandatoryDefault value
columnIdStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

convertWYSIWYGToText()
const columnId = '166345213822488731'; 
let column = new SimpleColumn(columnId);
column.convertWYSIWYGToText();

reconvertRecords(columnIds)


Use this method to retry the column conversion that failed due to an earlier error. For the columnIds parameter, provide an array containing the IDs of each target column.

If a record exceeds the maximum size of 32 MB, reduce its size before running the method.

Parameter(s):

NameTypeMandatoryDefault value
columnIdsArray of StringsYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

reconvertRecords()
const ids = ['154931135900000013', '153931135900000012', '152931135900000011'];
const column = new SimpleColumn('166345213822488731');
column.reconvertRecords(ids);