Allegati

Descrizione

Restituisce questa raccolta del campo allegati degli allegati.

Questa è una proprietà di sola lettura; il valore può essere visualizzato ma non impostato. Tuttavia, è ancora possibile aggiungere elementi alla (e rimuoverli dalla) raccolta utilizzando i metodi dell'oggetto Attachments.

Questa proprietà restituisce sempre un oggetto Attachments, anche se non esistono file allegati associati al campo. Se il campo non possiede file allegati, il metodo Count dell'oggetto Attachments contiene il valore zero.

Sintassi

VBScript

attachmentField.Attachments 

Perl

$attachmentField->GetAttachments(); 
Identificativo
Descrizione
attachmentField
Un oggetto AttachmentField che rappresenta un campo allegato di un record.
Valore di ritorno
Un oggetto di raccolta Attachments, contenente una serie di Oggetti Attachments.

Esempio

VBScript

' This example assumes there is at least 1 attachment field 
' associated with the record. 
set currentSession = GetSession
set attachFields = AttachmentFields 
set attachField1 = attachFields.Item(0) 
set theAttachments = attachField1.Attachments 

For each attachment in theAttachments 
     'Do something with each attachment 
Next 

Perl

# This example assumes that there is at least 1 attachment
# field associated with the record. Otherwise,
# GetAttachmentFields won't return anything interesting and an
# error would be generated

# Get the collection of attachment fields
$attachfields = $entity->GetAttachmentFields();

# Get the first attachment field
$attachfield1 = $attachfields->Item(0)

# Now get the collection of attachments from the attachments field
$attachments = $attachfield1->GetAttachments();

# Retrieve the number of attachments for the for loop
$numattachments = $attachments->Count();
for ($x = 0 ; $x < $numattachments ; $x++)
 {
 $attachment = $attachments->Item($x);
 # ...do some work with $attachment
 } 

Feedback