How to add an image to a representation class

Introduction

This ‘How to’ provides information on how to add a BLOB (image) to a representation class. Managing images is very simple in Version 7. Supervisor management can be used to manage images or they can be managed using your own code. The following development process describes how Supervisor management can be applied to manage images without the need to write a script code.

Prerequisite

The development process for the key element or entity to which image 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.

Data tables

As a rule, images 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 images. The following property (field) details are required:

Columns tabs:

Save and validate your data table.

Data classes

The property defined in the data table for the image must now be added to the data class.

Open your existing key entity data class. Add the image field, as follows:

Properties tab / Properties block:

Keys block:

Save and validate your data class.

Representation classes

The property defined in the data class for the image must now be added to the representation class.

Open your existing key entity representation class. Add the image field as follows:

Organization tab / Blocks block:

Displayed properties block:

Save and validate your representation class.

Completed result

The Menu item for the representation class will contain an area in which images can be managed (added or deleted). This area will either be in a new block or an existing block, depending on how the representation class was defined.