Count

Description

Returns the number of items in the collection. Get the number of fields of type AttachmentField, none or many. La propriété est en lecture seule.

Syntaxe

VBScript

collection.Count 

Perl

$collection->Count(); 
Identificateur
Description
collection
An AttachmentFields collection object, representing all of the attachment fields in a record.
Valeur de retour
A Long indicating the number of items in the collection object. This collection always contains at least one item.

Exemple

VBScript

set attachFields = entity.AttachmentFields 
numFields = attachFields.Count
For x = 0 to numFields - 1
     set oneField = attachFields.Item x 
     ' ... 
Next 

Perl

# Get the list of attachment fields

$attachfields = $entity->GetAttachmentFields()



# Find out how many attachment fields there

# are so the for loop can iterate them

$numfields = $attachfields->Count();



for ($x = 0; $x < $numfields ; $x++)

 {

 # Get each attachment field

 $onefield = $attachfields->Item($x);



 # ...do some work with $onefield

 } 

Feedback