For selected record types, you can define custom templates for exported documents. In Microsoft Word or LibreOffice, you can create a .docx file which, after being uploaded to Raynet, will serve as a template for a Quote, Business Case, or any other document type for your clients.
In this article, we will show you how to:
Tip: For best compatibility, we recommend creating templates in LibreOffice. You can find a list of supported fonts in this article.
For which record types can you create a custom template?
Business Case
Quote
Order
Project
Client
Contact Person
Lead
Activities (Task, Meeting, Event, Email, Call, Letter)
Important: Assistance with writing parameters in custom templates is not included in our standard support, as this is considered custom development for each client. If needed, we can provide contact details for our external partner, who offers paid consultations for template configuration.
How to enable custom templates?
Click on your name in the top menu and select Settings. In Settings, choose Custom Templates » Create New Template. Select the record type for which you want to create the template. You can choose one of the predefined templates or create your own. Confirm by clicking Select. After selection, the template is not yet active – it is visible only in Settings and will not appear in the export menu.
You can download the selected template or upload your modified version. After uploading the edited template, a preview will be generated with the currently filled-in data. If everything is correct, the final preview will be displayed. If the template contains errors, an error message will appear, and details can be found in the downloaded .docx file. The maximum template size is 5 MB.
Tip: If you need to export documents with different headers, e.g., if you have multiple branches, create a different export template for each branch. This way, users can choose which document they currently need without having to rewrite the addresses.
You can also freely edit the Name and Description of the template. The name will be visible to Raynet users in the export options. The template will appear in the export menu only after it has been activated.
The template is exported to.docx format by default so that users can edit it. If you want to avoid this and the PDF format is more suitable for you, check the Generate to PDF checkbox in Other settings.
If you want to directly attach the exported document to a record, select Attach the generated file to a record. It will be uploaded to attachments in the format you have selected in the previous step.
The exported file name can be modified just like the template name. You can use all the parameters of the given document. Now you just need to Save everything.
For Deal templates, it is also possible to set for which Trade Types and for which Stages the export template should be visible. In the document upload window, you will find the button Visibility settings for trade types.
After clicking this button, you can choose whether the template will be visible for all Deals or only for certain Types and Stages.
If you choose the second option, select specific Trade types (including all Stages) or use the arrow to open a list of individual Stages and select the ones you want. Finally, save everything.
Creating a completely custom template
If you have not picked any of the pre-made templates and want to create a completely customized document, choose the Custom Template option from the template selection.
Your template can be a standard Microsoft Word or LibreOffice document (.docx file) containing special tags in the text that define where and how CRM data should be inserted. There are three types of tags you will use:
Parameter
Cycle
Condition
Parameter
A parameter is a tag that inserts a value into the document based on how the corresponding field is filled in the CRM. Fields that you want to include in the document are inserted into the template using a parameter.
For example, the Quote Code field in the CRM has the value Q-23-004, and you insert it into the template using the parameter {code}.
The parameter usage in the document may look like this:
►
Cycle
The cycle parameter allows you to repeat sections of text. This is useful, for example, when listing Items or Participants in a Business Case. You only need to define everything once – whether there is one product in the quote or thirty, the correct values will always be inserted thanks to the cycle.
To use it, insert a cycle into the template and then add the required parameters (e.g., name, quantity, discount, etc.) from the corresponding tab inside the cycle.
Similar to a condition tag, the text is placed between an opening and a closing tag. The opening tag contains a hash symbol #, and the closing tag contains a slash /.
For example: {#items}...{/items}.
The cycle may then look like this:
In the exported template, a list of all items with the selected parameters inside the cycle will be displayed:
You can achieve row numbering in a cycle in the following way:
{#products}
{$rowNum}. {name}
{/}
Row numbers can also be used in conditions:
{#products}
{#$rowNum < 5}{name}{/}
{/}
Conditions and Operators
A condition allows you to control parts of the text so that they are included in the exported document only if the same condition is met in the CRM.
A list of available conditions can be found below in this article. Each condition is defined by an opening and a closing tag. The opening tag contains a hash symbol #, and the closing tag contains a slash /.
For example: {#hasDescription}...{/hasDescription}.
A condition may look like this:
►
In this example, the Note field in a Quote will be displayed in the document only if it contains text.
Conditions always start with the # symbol and end with a slash /.
{#hasBirthday}Birthday: {birthday}{/hasBirthday}
A condition can be terminated in two ways:
{#items.length > 3}...{/items.length > 3}
{#items.length > 3}...{/}
Operators that can be used within conditions:
Example:
!== inequality {#businessCasePhase !== "Closed Won"}...{/}
=== equality {#businessCasePhase === "Closed Lost"}...{/}
> greater than {#BusinessCaseItemDiscountPercent > 0}...{/}
< less than {#BusinessCaseItemDiscountPercent < 1}...{/}
<= less than or equal to {#OfferItemCount <= 1}... {/}
>= greater than or equal to {#OfferItemCount >= 4}... {/}
&& AND {#OfferItemCount > 1 && discount === "0.0"}... {/}
|| OR {#OfferItemCount > 1 || discount === "0.0"}... {/}
! negation {#!hasDescription}... {/}
A condition based on the number of items can be used, for example, in a Quote, Order, or Business Case. It may look like this:
{#items.length > 3} more than 3 items {/}
{#items.length <= 3} 3 items or less {/}
Arithmetic operations
Numeric fields can be added (+), subtracted (-), multiplied (*), and divided (/). For example, you can calculate the total package weight in an Order. This way, the total shipment weight will be recorded within the Order. For a parameter to be treated as a number, you must add AsNum after it.
In Custom Templates, select both optional fields from the Order parameter catalog.
The copied parameters may look like this:
{Product_oz_be3fg}
{Packaging_4f854}
Then insert a parameter for the sum and add AsNum after each value:
{Product_oz_be3fgAsNum + Packaging_4f854AsNum}
In the template itself, you will have numeric values (parameters for Content and Packaging) and their total (+AsNum) displayed as Total Weight.
The sum in the exported Order PDF will look like this:
Number Formatting
For numeric operations, you can choose your preferred number format. You can select either Czech or English formatting.
Parameter for Czech-formatted numbers:
{xxxAsNum | format:"cs"}» 378 800,00Parameter for English-formatted numbers:
{xxxAsNum | format:"en"}» 378,800.00
Decimal places are taken from your Raynet Settings. However, you can override them by adding a number after the colon for both formats, for example:{xxxAsNum | format:"en":4}
Parameter for adding decimal places:
{xxxAsNum | format:"en":4}» 378,800.0000
Date Values
You can also choose the format of date values:
Parameter for Czech date format:
{xxxAsDate | format:"cs"}» 27. 4. 2022
or with time: 27. 4. 2022 17:08Parameter for English date format:
{xxxAsDate | format:"en"}» Apr 27, 2022
or with time: Apr 27, 2022, 5:08 PM
Image
The image tag starts with the % symbol. For example, for a Client, it is {%logo}.
To change the size of the inserted image, you can add the size parameter.
{%image | size:70:70} The image will have a size of 70 px × 70 px.
Smart Tips for Creating Templates
Edit your document template with formatting marks enabled. This will help you better control the document layout.
Before uploading the final version of the template, adjust the .docx metadata so that the exported document contains only your own information.