Previous Topic

Book Contents

Book Index

Next Topic

Image from Attachment

In the 'Creating a MultiLine Mode' example, we need the ability to display an image taken from object's attachments. For this to be possible, the object type must have a special 'image' attribute. The following example shows how to create a transient image attribute. See also the 'Image Assignment' section.

In this example, we are going to create a transient attribute for the 'Person' object type and set it up so that it references the first image attachment of a particular 'Person' object:

  1. Open the 'Person' object type in the Object Type Customizer.
  2. Switch to the 'Transient Attributes' tab.
  3. Add a new transient attribute and give it a descriptive name ('Image4MLC' in our example).

    Help Image

  4. Double-click the 'Default Value' field of the new attribute to call the 'Default Value' dialog box. In the 'Direct Value' field of the dialog, enter ATTACHMENT:#0 (see the image below). This specifies that the value will be taken from the first attachment of the object.
  5. Click 'OK' to close the dialog box.

    Help Image

  6. Next it is necessary to specify the newly created attribute as an image attribute.

    With the new attribute selected, click the 'Edit Extended Properties' button. A dialog box gets opened. Click the 'Add' button to add a new extended property. Another dialog box gets opened. Select 'Image Attribute' as the property name. Select 'true' as the property value.

    Help Image

    Now you can insert a cell linked to this attribute and specify its 'Content Type' as 'Image'.

    Help Image

    Using standard attachment functionality, the user will be able to insert images in the cells by attaching image files to objects.

    Help Image

See Also

Example: Creating a MultiLine Mode