Share:

PREVIOUS  |  NEXT

Document Template Example


The following code will generate a document that users can print, when they have permissions for the Print Document action you configure with the document template. Below the code example, we display the resulting document.

If you wish to add an image to your document, you can add the code as shown in Line 9 below. You must upload your image in the UI Settings workspace, where you can also obtain the file path. You can also see examples of tags in blue font, such as those in lines 19 - 24. 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Sample Document Title</title>
</head>
<body style="background-color: White; font-family: Arial, Verdana, sans-serif">
<img border="0" src="/wpm/custom_files/mt_calliduscloud_13/screenimage/img6/CClogoSm.png">
<br><br>
<h1>Sample Document</h1>
<br>
This an example of how you can format an HTML document that collects case data, which an end user can later print.
<br><br>
<h3><i>Case Data</i></h3>
<table style="background-color: White; width: 800px; margin: 5px 0 5px 5px; font-size: 12px;">
<tr> <td width="150px"><b>Name:</b></td> <td> $!{case.name} </td> </tr>
<tr> <td width="150px"><b>Description:</b></td> <td> $!{case.description} </td> </tr>
<tr> <td width="150px"><b>Status:</b></td> <td> $!{case.status.name} </td> </tr>
<tr> <td width="150px"><b>Project:</b></td> <td> $!{case.project.name} </td> </tr>
<tr> <td width="150px"><b>Priority:</b></td> <td> $!{case.priority.name} </td> </tr>
<tr> <td width="150px"><b>Assignee:</b></td> <td> $!{case.assigneeName} </td> </tr>
</table>
<br>

<h3><i>Contact data:</i><h3>
<table style="background-color: White; width: 800px; margin: 5px 0 5px 5px; font-size: 12px;">
<tr> <td width="150px"><b>First Name:</b></td> <td>$!{contact.firstName}</td> </tr>
<tr> <td width="150px"><b>Last Name:</b></td> <td>$!{contact.lastName}</td> </tr>
<tr> <td width="150px"><b>Email:</b></td> <td>$!{contact.email}</td> </tr>
</table>
<br>

<h3><i>Account data:</i><h3>
<table style="background-color: White; width: 800px; margin: 5px 0 5px 5px; font-size: 12px;">
<tr> <td width="150px"><b>Name:</b></td> <td>$!{account.name}</td> </tr>
<tr> <td width="150px"><b>Description:</b></td> <td>$!{account.description}</td> </tr>
<tr> <td width="150px"><b>Location:</b></td> <td>$!{account.location}</td> </tr>
<tr> <td width="150px"><b>Web Address:</b></td> <td>$!{account.webAddress}</td> </tr>
</table>
<br>

<h3><i>Custom fields:</i><h3>
<table style="background-color: White; width: 800px; margin: 5px 0 5px 5px; font-size: 12px;">
<tr> <td width="150px">Duration:</td> <td>$!{case.getValue("Duration")}</td> </tr>
<tr>
<td width="150px">Is this billable:</td> <td>$!{case.getValue("Billing Status")}</td> </tr>
</table>
<br>     

<h3><i>This document was printed by user:</i><h3>
<table style="background-color: White; width: 800px; margin: 5px 0 5px 5px; font-size: 12px;">
<td width="150px"><td>${user.firstName} ${user.lastName} (${user.email})</td> </tr>
</table>               
</body> 
<div style="background-color: #FDF9D6; width: 99%; color: #363636; border: 1px solid #DCD8BF; padding: 5px;">
This document was generated using <a href="http://www.calliduscloud.com/workflow/">Workflow</a> - 
CallidusCloud's collaboration/case management/workflow platform
</div>
</html>


The above code results in the following printed version. Most of the information on the left of the form is statically generated, which means the information will always be the same. To the right of those fields, you will see the data that is dynamically created using tags, such as those in blue code above. All of the information that is generated using the tags is dependent on the context at the time the document is printed.