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");
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.