Create your own PDF template

Prev Next

Previously, Linda and José chose one of the invoice and quotation templates provided by Frisbii.
The initial idea was not to use their old invoice and quotation templates, but to take advantage of the implementation of Frisbii to improve them.

At the moment, they are discussing it with a few members of the Accounting and Sales teams.


Their colleagues are very motivated. Linda and José show them the two versions of their templates: the old Cloud Kicks invoices and quotations as well as the templates provided by Frisbii.
Together, they decide how to improve the packaged templates. With all these great ideas in her notebook, Linda meets Vijay, a member of the Cloud Kicks development team. He knows Visualforce very well and will show Linda how to modify the templates herself.

Retrieving Visualforce code on GitHub

Linda asks Vijay, developer at Cloud Kicks, to explain how to modify the PDF template. Vijay is also a Salesforce administrator, so he has the rights to access Visualforce pages.



In order to have an efficient session, Vijay sends Linda the links to some trailhead modules, in particular this one : Visualforce Basics.

Then he shows Linda how to get the Visualforce code from the template.


Steps

Prerequisites

To save the invoice template, first add the following custom label:

  • Short description: Late payment penalties

  • Name (important!): Penalty_for_late_payment2

  • Categories: PDF

  • Value: Any late payment will result in the application of a late payment penalty at a legal interest rate equivalent to that applied by the European Central Bank (ECB) to its most recent refinancing operation plus ten (10) points and a fixed collection fee of €40, in accordance with the provisions of Article L. 441-10 of the French Commercial Code.

Next:

  1. Please follow the Github link :

Depending on your Frisbii version, you can choose between two folders:

  • 3.233 - 2.246: Sofactoapp Template Version >233 & < 247

  • from 3.247: Sofactoapp Template Version >= 247

Important: In the following articles, we will focus on models from Frisbii version >= 3.247.

2. In GitHub, open the model you are interested in.

You can choose between FACT_TMP_1 and FACT_TMP_2.

Vijay chooses FACT_TMP_1.

3. In another browser window, connect to your Salesforce org, and go to Setup.
4. Type Pages in the search bar of the setup navigation.
5. Go to Visualforce Pages
6. Click on the button New

7. In GitHub, click the Raw button.

8. Copy the Visualforce code from the template (CTRL+A; CTRL+C). Paste the code into the new Visualforce page (CTRL+V).

9. Fill in the Label field (the API name is filled in automatically).

10. Save the page by clicking the Save button.

There you go, the page is ready to be customized!

Setting up the new Visualforce page in the Template objet

Before improving the template, Linda follows one best practice : she sets up the new Visualforce page in the template object. Thus she can test the template on a test invoice easily afterwards. To do so, she opens the Templates object.

Steps

1. Click on the Application Launcher.

2. Type Template in the search bar.

3. Click on the Templates object.


4. In the Template object, click on the button New.

5. Enter a name for the template and the corresponding Visualforce Page (you just created)

Beware: The correct writing of the name is essential. If the name is not the same, the set up will not work.


6. Check the check box Active in order to make the template available on the Corporate Names tab and the Invoice tab.

7. Choose the type Invoice.

8. Click on the Save button. Later we can set up a Thumbnail to facilitate the choice from the Corporate Names tab. But for now, let's continue the setup.

Selecting the new Template on the Corporate Names tab

Now that the new template is added to the Template object, we can change it also on the Corporate Names tab.

Note: If you want to modify your Visualforce page later, and you don’t want to disturb the invoice process, you can change the template only on a test invoice.
On an invoice record, you can choose a template in the Order Templates field (given that the template is saved in the Template object).


At Cloud Kicks, they are in the installation phase of Frisbii. This is why we are going to change the template directly on the Corporate names tab. Here are the steps to follow.

Steps

  1. Go to the Corporate Names tab

  2. Select your new template in the Default templates Section.


Here you are, your template is set up!

Giving access to your Visualforce page

Change the access rights to the created Visualforce page, so that the your colleagues in charge of the billing process can use it.

Steps

  1. Select the permission set for users who need to generate invoices (for example, Frisbii Finance).

  2. Go to Apps > Visualforce Page Access.

  3. Click Edit and add your template to the Enabled Visualforce Pages column, then save.