Print

GetAttachmentData

This function gets specified parameter of the currently selected attachment.

Syntax

GetAttachmentData("fieldTitle","paramName");

Function arguments

  • fieldTitle – (String) a name of the case document-type field containing attachment or name of the case attachment.
  • paramName – (String) a name of the parameter that is to be retrieved for the given attachment. Allowed values: [ id | createddate | createdbyid | createdbylogin | modifieddate | modifiedbyid | modifiedbylogin | name | extension | isexternal | externallink | version | size | ocrid | ocrstate | ocrpagecount | ocrresponse | hash | pagecount].

Return value

This function returns String.
Returns the value of the specified parameter from the file attached in the specified case field or the case attachment list.

WARNING! In case of passing not existing parameter name, this function throws an exception registered in the system log and stops rule execution. You can handle this exception by using try{…} catch {…} formula.

Examples

Example 1:
This returns the extension of the attachment from the current case’s 'AttachmentField1′ field.

attextension = GetAttachmentData("AttachmentField1","extension");

Example 2:
Let’s assume that there is a document-type field named ”Document scan” on the case form and a user wants to get information about a volume of the attached file to the „Document scan” field. The following sample code throws an exception because there is no 'volume’ parameter for the attached file. The exception is handled in try {…} catch {…} formula.

try
{
  sFileVolume = GetAttachmentData("Document scan","volume");
}
catch
{
  ShowMessage(1,"The attached file has no such parameter as 'volume'. Exception details: "+exception);
}
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?