Syntax

result = FORMATFIELD (tag, occ, format)

Arguments

tag: field tag

occ: integer

result, format: text

Meaning

This function applies to fields of the Image data type and to fields of the Application data type:

Image - For this field type, with the formatfield function you format the contents of occurrence number occ of database field tag (an image field) according to either the ‘image’, ‘thumbnail’ or ‘default’ format. These three options refer to the Retrieval path, Thumbnail retrieval path and respectively Storage path options on the Image properties tab of the relevant tag in the Application browser. In effect, the formatting merges an incomplete path to a linked image from the image field with the rest of the required path as specified in the field properties. In result, the complete path to the image will be produced. In Adlib you could use this path to print the image via the PRINTIMAGE ADAPL command (only with the complete path could the image be retrieved and printed from within an adapl), but unfortunately that function is not supported by Axiell Collections.

More specific, the three format options do the following:

‘image’ – use Retrieval path for formatting, unless that property is empty, in which case Storage path must be used;

‘thumbnail’ – use Thumbnail retrieval path for formatting;

‘default’ – use Storage path for formatting.

Application - For this field type, with the formatfield function you format the contents of occurrence number occ of database field tag (an application field) according to the ‘default’ format. This option refers to the Storage path option on the Application field properties tab of the relevant tag in the Application browser. In effect, the formatting merges an incomplete path to a linked file from the application field with the rest of the required path as specified in the field properties. In Adlib, only with the complete path, the file could be retrieved and launched from within an adapl. However, the LAUNCH ADAPL command is not supported in Axiell Collections. So in result, the complete path to the file will be produced, but only in Adlib could the file then be opened in its associated software application via the LAUNCH ADAPL command.

More specific, the format option does the following:

‘default’ – use Storage path for formatting.

Background

It is possible that in your application the field which will hold the path to a linked image, does not display the full path, yet only the file name of the image, for example. If that is the case, then this has been set up for your application specifically in the Retrieval path option on the Image properties tab of the selected image field.
Collections automatically merges the file name from the image field with the Retrieval path to obtain the complete path or the URL. With this, the relevant image can be retrieved for display in Collections or for printing to a Word template. When printing of images through an adapl-only output format was still possible (in Adlib), the data would then be accessed differently: in that case, a consequence was that adapls would retrieve the file name from the image field, but wouldn't merge it with the Retrieval path, making it impossible to find and print the image. This is where the FORMATFIELD ADAPL function became necessary: it merges the file name (or partial path) from an image field with either the Retrieval path, the Storage path or the Thumbnail retrieval path to form a complete path.

Example 1

result = formatfield (FN, 1, 'image')

Result

The incomplete path to the image in FN[1] will be formatted according to the Retrieval path field property of FN. The full path will then be put in the result variable.