Print

AddCasePrint

The AddCasePrint() function adds an attachment created from the case print form to the case attachment list or the given document-type field. It may also generates that attachment in PDF format. As a result AddCasePrint() function returns a boolean value that indicates whether action has been performed correctly or not.

WARNING! This function is not meant to be used in periodic rules, as it might cause problems with language in the generated file as it will be the same as on server. It is best to use it inside manual rules where a user’s language setting is enforced.

Syntax

AddCasePrint(fileName);
AddCasePrint(fileName,fieldName);
AddCasePrint(fileName,fieldName,toPDF);

Function arguments

  • fileName – (String) a name of the resulting file;
  • fieldName – (String) [optional] a name of the document-type field where the generated file will be placed in;
  • toPDF – (Boolean) [optional] set true if the generated file should be in PDF format and then the file name should contain „.pdf” extension.

Return value

This function returns Boolean.
It returns true if the attachment was created, otherwise it returns false.

Examples

Example 1:
This will add a file named print.html containing the case print form to the case attachment list.

AddCasePrint("print.html");

Example 2:
This will add a file named print.html containing the case print form to the document-type field named print.

AddCasePrint("print.html","print");

Example 3:
This will add a file named print.pdf containing the case print form converted to PDF format to the document-type field named print.

AddCasePrint("print.pdf","print", true);
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?