This article outlines how to create a simple quote template.
In this step-by-step description, we will create a quote template, consisting of a list of related products, relevant quote information, and tax/discount details. This template will make use of the following features:
This guide is based on a sample template. To view the finished sample template, please see the attached document at the bottom of this article.
For a video version of this guide, please see the video below:
Step 1: Setting the base entity
When creating a template, it is always important to set your base entity first. This is because the fields displayed in the Template Designer will be determined by this base entity, and once a field has been inserted into a template, the base entity can no longer be changed. In this case, our base entity is Quote, so we will set the Type accordingly.
Step 2: Adding our text and general structure
We will begin by including our text and general structure to our template. For this example, this is what our template looks like.
Step 3: Adding our standard fields
To create our quote template, we need to include some fields that cover the basic information about our quote, such as details about our customer and the quote itself. These standard fields will come either from the Quote entity, or from its lookup fields
Step 4: Creating our table
For our table, we will base it on the Quote Line entity. We will create it by accessing the Relationship Designer and locating the Quote->Quote Line relationship. Once that relationship has been selected, we will select the Amount, Description, Price Per Unit, and Quantity fields.
After we select the fields, we need to add a Link Element. This can be found at the bottom of the Relationship Designer.
This will bring us to another Relationship Designer window. Here, we need to select the Product->Quote Line relationship. Once that is selected, we must also select the Name field to get the name of our product.
With that, click OK on both Relationship Designer windows. If done correctly, your fields list under the Additional Tab should look something like the following:
To create the table, double click on the Name field. We will structure our table like so:
Then, we will fill in the fields of our table, and give each column an appropriate name. We will also add the Total Detail Amount field from the Standard tab in the footer. Our table now looks like the following:
Step 5: Setting up the condition fields
On top of our table of products, we also want to include some extra fields that show any discounts or taxes that may be applied to our invoice. However, we only want to include these fields if they are applicable i.e.: if there are no discounts available, we do not display that field.
This is where Condition Fields come into play. We can include these fields in our template to do exactly as mentioned.
We’ll begin by creating a Condition Field through the Insert Fields menu.
We will first create a condition field in the footer next to our Total Detail Amount field. We will use this field to print out text indicating if the Total Detail Amount is the total or just the subtotal.
To do this, we will need to create an else block. This can be done by selecting the Create else block checkbox in the Relation section. Then, we will select the Total Discount Amount and Total Tax fields in the designer and set their operators to greater than. For the value, both will be set to 0.
It’s important to ensure that our fields are grouped. Otherwise, the condition will not work correctly. To group them, select both rows and click the Group OR button.
Click OK. The condition field will be created where your cursor was last positioned. Since we set the condition field to be created with an else block, two fields should be positioned right next to each other. In our table, the condition field should look like this:
Since we want this field to indicate if the Total Detail Amount is a total or subtotal, we will enter text into each condition block.
With the text entered as above, the text “Subtotal:” should appear if the Total Discount Amount or Total Tax fields are greater than zero. Otherwise, the text “Total:” will appear.
We still need to create a few more condition fields. Under our product table, we want to display the discount and tax information, along with the quote’s total amount, if those fields contain data. In total, we will create three more condition fields.
We will begin with the discount condition field. This can be created like the previous condition field, but instead, we will leave the else block blank, and select only the Total Discount Amount field.
The above process can be repeated for the Total Tax condition field.
For our total condition field, we can simply reuse the existing condition. Just select the Use existing condition checkbox and select the condition we used previously for the “Subtotal/Total” condition blocks.
When those condition fields are finished, they should be placed similar to the following:
We will add standard 4×1 Word tables to each condition field, as we later want to keep our data organized.
We will add some text to each table, and within the first two condition fields, we will add a Join Table field.
The Join Table field will combine the first table immediately above and below it. For our template, we want to include this to combine our tables for organizational purposes. This field can be added through the Insert Field menu.
We will add this field below the discount and tax tables, but place them in such a way that they are still within the condition fields.
Then, we remove some of the whitespace separating the tables add our relevant fields. The relevant fields are the Total Discount Amount, Total Tax, and the Total amount fields.
Step 6: Generating a document
At this point, the template should something like this.
Then, we remove some of the whitespace separating the tables add our relevant fields. The relevant fields are the Total Discount Amount, Total Tax, and the Total amount fields.
If we were to merge this template with some a Quote record in our environment, this is what we would have as a result. Note how the discount and total tables have combined:
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.