Count
Description
Returns the number of items in the collection. This property is read-only.
Syntax
Perl
$collection->Count();
- Identifier
- Description
- collection
- An Attachments collection object, representing the set of attachments in one field of a record.
- Return value
- A Long indicating the number of items in the collection object. This method returns zero if the collection contains no items.
Example
Perl
#Get a list of attachments
$attachfields = $entity->GetAttachmentFields();
# Get the first attachments field
$attachfield1 = $attachfields->Item(0)
# Get the collection of attachments from the attachments field
$attachments = $attachfield1->GetAttachments();
#Get the number of attachments
numAttachments = $attachments->Count();