Gonexa University

Associated template

Several types of document templates exist to allow the management of new use cases, such as appendices to the main templates.

Prerequisites
✓ Have already configured a main template
✓ Update the package to the latest version

Pourquoi ajouter des documents associés ?

Associated document templates can be static, dynamic, multiple, or chart-based to meet your most advanced use cases.

What is an associated document?

Associated documents allow you to add one or more documents after a main document during generation. These documents can be added with or without conditions. They are dependent on the main document and cannot be generated on their own.

Related document template

CASE #1
Create the associated document type template
  • First, you need to create and configure the main document template
  • In the Doc tab of your main template, click New Associated Template
  • Give the template a name and choose the type of associated template you wish to create from the following options:
    Static
    The associated document is fixed and contains no tags. There is no main object selection. The page can be a PDF

    Useful for adding Terms and Conditions
    Dynamic
    The document contains dynamic tags. In this case, the object is selected from the main or secondary objects of the main document template

    Use this to add an appendix with dynamic information
    Multiple
    The document contains tags and repeats based on the number of child objects in the main document. In this case, the object is selected from the child objects of the main document template

    Used when displaying product sheets. If the main document contains a table with 5 products, the associated document will be added 5 times after the main document, once for each product
    Chart
    The document is an Excel file containing a chart to be displayed on the generated document

    Appendix used for an advanced account summary, for example
  • Validate and you will be redirected to the associated document template configuration
  • Add additional objects as needed, include your document tags if it is not static, and upload the associated document template
  • Your associated template will be linked to the main template from which you created it
  • Test the generation from your main template to find the associated document added to the first one upon generation


Link an existing associated document template

If an associated template needs to be linked to multiple main templates, create the link between the two depending on where you are currently located

  • On your associated template, go to the "Main templates" tab to find the list of all main templates linked to this associated template
  • Click "Link to a main template"
  • Select the main document template you wish to link and click "Choose"
  • Refresh the page and find a new main template (n) in the associated list
  • From this list, delete the link or return to the main template using the buttons
  • On your main template, go to the Doc tab then click on Link an associated document template
  • Choose an existing associated template then save
  • Select the associated template and click "Choose"


Add conditions for displaying an associated document

You can add conditions for displaying an associated document after the main document.

Example
The "Supplier T&Cs" associated document template should only be added to the Quote if the account is of the Supplier type. The "Customer T&Cs" associated document template will only be added to the Quote if the account is of the Customer type.

  • On your main template, go to the Doc tab, then for the desired associated document template, click on the action arrow and then on Edit condition
  • From the existing links, click the arrow and then "Edit condition"
  • Build your display condition as desired
  • Click "Choose"
  • On your main template, go to the "Doc" tab, then access the "Associated templates (n)" block
  • From the existing links, click the arrow and then "Edit condition"
  • Build your display condition(s) as desired
  • Click "Choose"

Graphic Associated Document Template

CASE STUDY


This associated template is a technical appendix for creating charts from Excel data and displaying them in a Word or PowerPoint document.

Prerequisites
✓ Use Grenoble package version 2.3
✓ Have a document template and know how to manage tables and Excel format documents with Gonexa
✓ Verify that the "Graph" picklist value is available; if not, follow the procedure

Add the "Graph" picklist value if it is not visible
  • From Setup, go to Object Manager > Document Template > Fields & Relationships
  • Search for the Type field (gnx_Type__c)
  • If the "Graph" value is missing, click "New (values)", name it "Graph", and confirm.
  • Go to the "Record Types" tab > Associate, edit the picklist available for the Type field, and move the "Graph" value from Available to Selected. Save.


Create an associated template of type Graph
  • From your main document template, go to the tab
  • If necessary, create child objects to generate graphs on linked objects (e.g. Contract + Contract Lines)
  • Click "New associated model" and name it (e.g., Charts).
  • Select the model type: Chart (Excel).
  • The "Main model object selection" field will be filled in by default.
  • Click "Choose".


Create the Excel file
  • Create an Excel file with the fixed and dynamic parts, and add data tables via the "Insert" > "Table" ribbon so that they are correctly defined as Excel Tables.
  • Add the header and tags as you would for a standard child table.
  • Create the charts by selecting the relevant table, then go to the "Insert" tab > "Chart".
  • Name your chart.
  • Select the table and give it a name in the "Table" tab that is identical to the first chart.
  • Add a title and a legend to each chart.
  • Click on the chart and define a unique name for each chart in the "Name Box".

Example
A table named "GraphA" and a chart named "GraphA"
A table named "GraphB" and a chart named "GraphB"


Insert the chart into the main document
  • From Salesforce, in the Main Templates block, access your main model
  • Open the main document (Word or PowerPoint)
  • Place the tag where you want to insert the chart.

    Chart Tag

    Tag syntax: {!gnxgraph|Chart_Name(w=100)}

    Parameters:
    Chart_Name
    = corresponds to the exact name of the chart in Excel
    w=200 = sets the chart width in pixels

    Example
    The tag {!gnxgraph|GraphA(w=150)} uses the exact name of the chart in Excel and will display the chart at a reduced size of 150 pixels.

    Note
    The table name must be exactly the same as the chart name. A table and its chart displayed on the same Excel sheet will allow the chart rows to be updated.