How to add a clob text to a representation class
This ‘How to’ provides information on how to add a CLOB (text) to a representation class. Managing CLOBS is very simple in Version 7. Supervisor management can be used to manage CLOBS or they can be managed using your own code. The following development process describes how Supervisor management can be applied to manage CLOBS without the need to write a script code.
The development process for the key element or entity in which CLOB management is required must have been completed. For example, the data table, data class, and representation class must have been defined, and the class representation made visible in the client.
As a rule, CLOBS should be stored in their own data table, separate from the main data. This practice particularly helps with the use of disk space.
Using the Tables option (Development > Data and Parameters > Tables > Tables), create a new Data table (MYTABLE1) for storing CLOBS. The following property (field) details are required:
The key field must be linked to the main data table (field Linked table).
A field specifically for a CLOB must be added. The data type (field Type) for this field must be set to ACRTF.
Data type 'ACRTF' is a predefined data type for managing text files. Other data types for managing CLOBS are 'ACHTML' for 'HTML' and 'ACPLAIN' for plain text. Each data type is defined as a rich media type with Supervisor management.
For example, the data type is set for text files (field Internal type on the General tab), rich media (field Type on the Class tab) with Supervisor management (field Supervisor mgmt on the Class tab is set to Yes).
Save and validate your data table.
The property defined in the data table for the CLOB must now be added to the data class.
Open your existing key entity data class. Add the CLOB field, as follows:
Type: This must be set to ACRTF (see Data tables above).
Table of the lob: This must be set to the Data table name defined for your CLOBS (MYTABLE1).
Lob field: This must be set to the field defined in the Data table specifically for the CLOB.
Value: This must be set to the key field in the main data table, for example, the data table for the key entity.
Note: You will not be able to validate until the table key has been entered.
Save and validate your data class.
The property defined in the data class for the CLOB must now be added to the representation class.
Open your existing key entity Representation class. Add the CLOB field, as follows:
To add the CLOB field to a new block, add an identifiable Code and Section.
Note: This step is not required if the CLOB field will be added to an existing block.
Property: Add the code for the CLOB defined for the Data class.
Block: Add the block the CLOB is to be managed in.
Select the Detail, Edit, and Enterable check boxes.
Save and validate your representation class.
The Menu item for the representation class will contain an area to manage CLOBS. This area will either be in a new block or an existing block, depending on how the representation class was defined.