Function GetAttachmentFilesAlias
Make up a property URL
GetAttachmentFilesAlias([TYPE],[KEYEXPRESSION],[SUBFOLDER],[FILEWILDCARD],[FILTEREXPRESSION],[ALIAS])
NOTES: This function will only pick up files from one folder, it will not recurse sub folders.
Parameters
| # | Type | Passing | Default | Name | Description/Comments |
|---|---|---|---|---|---|
| 1 | integer | required | n/a | TYPE | Folder type 0 = Property Folder 1 = People Folder 2 = Master Property Folder |
| 2 | string | required | n/a | KEYEXPRESSION | The key field expression to use to get the item folder which is usually a poreprty or person code This is an expression to be evaluated so must be enclosed in quotes e.g. "PROPCODE" = property code, "CLCODE" = Client Code, "CLCODE2" = Client code etc Note: If TYPE=2 (Master Property Folder) and "PROPCODE" is passed then it will look for the master property i.e. PROPCODEMS of the PROPCODE |
| 3 | string | required | none | SUBFOLDER | An optional sub folder of the main folder made. This allows files to be picked from a sub folder of the property or person folder. |
| 4 | string | required | *.* | FILEWILDCARD | A file wildcard to apply e.g. *.* or *.pdf or *.jpg or EmailAttachments*.jpg
This wild card can also be an expression to make up dynamic file names based on the data. e.g. 'Recharge'+alltrim(REFERENCE)+'.pdf' In this above example the file name is made up from strings plus the field name REFERENCE, it must be passed in surrounded by double quotes |
| 5 | string | required | n/a | FILTEREXPRESSION | Th is the filter expression that is applied to each record to determine whether this is execute for that record. This is an expression to be evaluated so must be enclosed in quotes e.g. "TRAXTYPE='PIN'" "TRAXTYPE='SIN' AND CLIENT2.CLCLASS='C'" |
| 6 | string | optional | alias() | ALIAS | The table alias to apply the KEYEXPRESSION and FILTEREXPRESSION loop on. |
Returns
A list of full path and file names that are found delimited with a semi colon (as required by the output engine).
Examples
This will pick up files in the CLCODE2 people folder for Transaction Types of Recharge Invoice where the name of the file is made up from the expresion.
The system will work out if the file(s) exists and if they do add them to the attachment list
[[GetAttachmentFilesAlias(1,"CLCODE2","","'Recharge'+alltrim(REFERENCE)+'.pdf'","TRAXTYPE='PIN'",alias())]]
Additional notes
This function is available within PCHomes Estate Agent Software, Letting Agent Software and Property Management Software suites.It is designed to be used in the output engine to help automatically pick up attachment files for emails.
The output that requires this will need to be configured to call this function with the appropriate parameters.
