DeleteAttachment
This function returns the number of documents that are attached to current case.
Syntax
DeleteAttachment("field");
DeleteAttachment("all");
DeleteAttachment("invoice.pdf");
Function arguments
- fieldName|fileName – (String) Name of the file field or name of the file from documents list. If set to „all” then all documents not assigned to fields will be deleted
Return value
This function returns Boolean.
Returns true if document was found and deleted, otherwise returns false.
Examples
Example 1:
This will delete file from Invoice field.
DeleteAttachment("Invoice");
Example 2:
Delete all documents from documents list in case. Does not delete documents from fields.
DeleteAttachment("all");
Example 3:
Delete file with invoice.pdf name from documents list.
DeleteAttachment("invoice.pdf");