AttachmentFactory object

Manage attachments of the current field object.

You get an AttachmentFactory object from the Attachments property of objects such as Bug, Req, Test, TestFolder, TestLabFolder, and TestSet.

Public methods

This object supports the following methods.

Method Description
Item

Gets an attachment object managed by the factory by its key.

Syntax: Item(itemKey)

Parameter:

  • itemKey. A number that represents the attachment ID.

NewList

Creates a list of attachments according to the specified filter.

Syntax: NewList(filter)

Parameter:

  • filter. A TDFilter.Text string that defines the criteria for filtering items in the factory. If an empty string is passed, the returned list contains all the child items of the current factory object.

RemoveItem

Removes an attachment from the database. Removal takes place immediately, without a Post.

Syntax: RemoveItem(itemKey)

Parameter:

  • itemKey. A number that represent the attachment.ID, a reference to the Attachment object, or an array of Attachment.IDs.

Public properties

This object supports the following properties.

Property R/W Type Description

 Fields

R List

The list of all available fields for the entity managed by the factory.

Syntax: AttachmentFactory.fields

 Filter

R Object

The TDFilter object for the factory. See TDFilter object.

Syntax: AttachmentFactory.filter

Example

Example: Download a file from an attachment object

Back to top