- 
    <async> cleanupFiles(editObject [, filter] [, keepTopX])
- 
    
    
        Instantly cleanup files, but keep top X, optionally SQL expression filtered
     Parameters:
    
    
        
        | Name | Type | Argument | Default | Description |  
            
                | editObject | EditObject |  |  |  |  
            
                | filter | string | <optional> 
 | "" | SQL filter expression, e.g. "COMMENT like '%template%'" |  
            
                | keepTopX | number | <optional> 
 | 7 | Keep only the top X files, sorted highest/latest K_SORT first |  
 
    
	
	
	
    
    
    
    
	
	
	
	
	
	
	- Source:
- 
		
	
 Exampleawait crm.ws.cleanupFiles(document, "", 7);
await crm.ws.cleanupFiles(document, `COMMENT like '%template%'`, 0); 
- 
    <async> deleteFiles(editObject [, filter])
- 
    
    
        Instantly delete files, optionally SQL expression filtered
     Parameters:
    
    
        
        | Name | Type | Argument | Default | Description |  
            
                | editObject | EditObject |  |  |  |  
            
                | filter | string | <optional> 
 | "" | SQL filter expression, e.g. "COMMENT like '%template%'" |  
 
    
	
	
	
    
    
    
    
	
	
	
	
	
	
	- Source:
- 
		
	
 Exampleawait crm.ws.deleteFiles(document);
await crm.ws.deleteFiles(document, `COMMENT like '%template%'`); 
- 
    <async> getFiles(editObject, filter, includeBlobContent)
- 
    
    
    
    
    
        Parameters:
    
    
        
        | Name | Type | Description |  
            
                | editObject | EditObject |  |  
            
                | filter | string | Server-side SQL filter expression, added as filter property of [TDataSet](https://help.efficy.io/extras/serverjs.html#TDataSet) |  
            
                | includeBlobContent | boolean | On true, returns all blob streams (e.g. attachment, thumb) |  
 
    
	
	
	
    
    
    
    
	
	
	
	
	
	
	- Source:
- 
		
	
 Returns:
    - 
        Type
    
- 
        
Promise.<Array>
    
 Exampleawait crm.ws.getFiles(document, `COMMENT like '%.docx'`, false);