AddAttachmentFromTemplate
This function adds attachment created from given template to current case.
Syntax
AddAttachmentFromTemplate(templatName,fileName); AddAttachmentFromTemplate(templatName,fileName,fieldName);
Function arguments
- templateName – (String) Name of the template file
- fileName – (String) Name of the resulting file
- fieldName – (String) [Optional] Name of the file field to which attachment will be assigned
Return value
This function returns Boolean.
Returns true if attachment was created, otherwise return false.
Examples
Example 1:
This will create document from Contract.docx template, name it based on value in Number field and add it to attachments list. Template file is configured to create PDF file so the result will be pdf file.
AddAttachmentFromTemplate("Contract.docx","Contract_"+[Number]+".pdf");
Example 2:
This will create document from Contract.docx template, name it based on value in Number field and add to Contract field
AddAttachmentFromTemplate("Contract.docx","Contract_"+[Number]+".docx","Contract");