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.
- 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.
This function returns Boolean.
It returns true if the attachment was created, otherwise it returns false.
This will add a file named print.html containing the case print form to the case attachment list.
This will add a file named print.html containing the case print form to the document-type field named print.
This will add a file named print.pdf containing the case print form converted to PDF format to the document-type field named print.