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):
| Name | Type | Mandatory | Default value |
|---|---|---|---|
| columnId | String | Y | N |
Return:
| Type | Description |
|---|---|
| Void | This method does not return a value. |
Example:
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):
| Name | Type | Mandatory | Default value |
|---|---|---|---|
| columnId | String | Y | N |
Return:
| Type | Description |
|---|---|
| Void | This method does not return a value. |
Example:
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):
| Name | Type | Mandatory | Default value |
|---|---|---|---|
| columnIds | Array of Strings | Y | N |
Return:
| Type | Description |
|---|---|
| Void | This method does not return a value. |
Example:
const ids = ['154931135900000013', '153931135900000012', '152931135900000011'];
const column = new SimpleColumn('166345213822488731');
column.reconvertRecords(ids);