Condizioni di notifica
Questo evento viene notificato dal framework quando viene richiesto di memorizzare uno degli allegati di un documento. Solitamente viene generato perché viene chiamata da codice la procedura SetAttachment del documento.
Utilizzo consigliato
L'evento deve salvare l'allegato passato come file secondo la politica di memorizzazione implementata nell'applicazione e ritornare al chiamante un identificativo univoco dell'allegato.
Argomenti
| Doc | Documento che ha richiesto il salvataggio dell'allegato. |
| Type | Stringa che rappresenta il tipo di allegato, così come passata dalla funzione SetAttachment. |
| File | Stringa che contiene il percorso del file da allegare. |
| Code | Stringa che rappresenta il codice identificativo dell'allegato, così come passata dalla funzione SetAttachment. Può essere vuota. |
| Description | Stringa che rappresenta la descrizione dell'allegato, così come passata dalla funzione SetAttachment. Può essere vuota. |
| Result | Parametro stringa di output. |
Esempio di codice
// ********************************************************
// Fired when a document asks to set one of its attachments
// ********************************************************
event DocumentHelper.SetAttachment(
IDDocument Doc // Document that wants to get its attachments
string AttType // Attachment type
string AttFile // File name of the attachment
string AttCode // Attachment Code: may be an empty string
string AttDescription // Attachment Description: may be an empty string
inout string Result // Set it to the ID of the attachment
)
{
string AttID = "" //
//
// Generate a new GUID
AttID = newDocID()
//
insert values into Allegati
set ID = AttID
set TipoAllegato = AttType
set Codice = AttCode
set Descrizione = AttDescription
set IDDocumento = Doc.docID()
set NomeTipo = Doc.typeName()
//
Result = AttID
}
// Fired when a document asks to set one of its attachments
// ********************************************************
event DocumentHelper.SetAttachment(
IDDocument Doc // Document that wants to get its attachments
string AttType // Attachment type
string AttFile // File name of the attachment
string AttCode // Attachment Code: may be an empty string
string AttDescription // Attachment Description: may be an empty string
inout string Result // Set it to the ID of the attachment
)
{
string AttID = "" //
//
// Generate a new GUID
AttID = newDocID()
//
insert values into Allegati
set ID = AttID
set TipoAllegato = AttType
set Codice = AttCode
set Descrizione = AttDescription
set IDDocumento = Doc.docID()
set NomeTipo = Doc.typeName()
//
Result = AttID
}
Si ricorda che il framework non stabilisce come devono essere memorizzati gli allegati, ma solo la canalizzazione degli eventi ad essi relativi.
Ultima modifica: 23/03/2021 / Validità: da 6.5.2680
evento