ITEM TYPE: "ATTACHMENT"

ITEM TYPE: "ATTACHMENT"

This type of ITEM is used to display attachments in a FORM.

This ITEM does not contain itself the bytes of the attachment. Instead, it must reference an ITEM of type FILE (which can lie in the same FORM or in another one). For this reason, the FORMULA of this ITEM must return a valid reference of an ITEM of type FILE.

Characteristics of ATTACHMENT ITEMS

ATTACHMENTS are not handled as any other type of ITEMS (e.g. TEXT, DATE, NUMBER...). The difference is that it will be considered a property of the FORM rather than a ITEM of the FORM. In terms of API functions this means:

API FunctionBehavior
form_get_summary ()ITEMS of type 'ATTACHMENT' will not be returned in the list of questions. They will appear in the "<attachments>" section.
form_get_question ( )If you try to invoke this function on an ITEM of type "ATTACHMENT", it will return an error, for it is not considered a regular ITEM
form_set_answer ()If you try to invoke this function on an ITEM of type "ATTACHMENT", it will return an error, for it is not considered a regular ITEM

Other features

The implementation of ITEMs of type ATTACHMENT make it possible to show the same attachment in several FORMs, because in the end they are only a reference to another ITEM of type "FILE".

You can even decide in run-time if an attachment should be visible in a FORM or not by configuring the VISIBILITY property of the ITEM