Gonexa University

Initial training


The Gonexa Doc solution is Gonexa's historic solution for generating a document from a template in the format .docx. xlsx .pptx .pdf

Custom format management

The characters included in the Date format string are interpreted as a custom format and time string. Add a standard specifier to define how the desired information is displayed.

Format date & numbers

The date format can be important to make the document easier to read.

Training requirements

  • Install, configure and know how to create a document template
  • Add a tag using the assistant

📅 Customize the date format

CHOICE OF EXTENSIONS

FORMAT SPECIFIER

DESCRIPTION

example

{! Tag | API name(d)}

Short date

01/09/2023

{! Tag | API name(D)}

Long date

Monday September 10, 2023

{! Tag | API name(f)}

Long date+short hour

Monday September 10, 2023 13:30

{! Tag | API name(F)}

Long date+long hour

Monday September 10, 2023 13:30:50

{! Tag | API name(g)}

Short date+short time

10/09/2023 13:30:50

{! Tag | API name(G)}

Short date+short time

10/09/2023 13:30

{! Tag | API name(M)}

Month+day

September 10

{! Tag | API name(R)}

RFC1123

Monday, September 10, 2023 13:30:03

{! Tag | API name(T)}

Long hour

13:30:50

{! Tag | API name(t)}

Short hour

13:30

{! Tag | API name(Y)}

Date+month

September 2023

{!Label|APIName(dd MMMM yyyy)}

You can create complex tags with the following format specifiers in the form {!Object|Field(dd MMMM yyyy)} for example. You can also choose to use hyphens or “/” between each date format.

01 09 2023

{!Label|APIName(d)}

Day of the month, from 1 to 31

1

{!Label|APIName(dddd)}

Full name of the day of the week

lundi

{!Label|APIName(yyyy)}

4-digit year

2023

🔢 Customize the number format

GENERATE A NUMBER FORMAT

FORMAT SPECIFIER

FIELD TYPE

example

{! Tag | API name(C4)}

MOTTO

123,45€

{! Tag | API name(D)}
Optional: precision specifier
{! Tag | API name(D6)}

DECIMAL

1234
-001234

{! Tag | API name(F)}
Optional: precision specifier
{! Tag | API name(F4)}

FIXED POINT

1234.56
1234,5600

{! Tag | API name(P)}
Optional: precision specifier
{! Tag | API name(P4)}

PERCENTAGE

100.00%
-39.7%

{! Tag | API name(N)}
Optional: desired number of decimals
{! Tag | API name(N3)}

NUMBER

1.234567
1,234

For more information, see the following article: https://learn.microsoft.com/fr-fr/dotnet/standard/base-types/standard-date-and-time-format-strings

Do calculations

Make a product subtotal or simply count the number of products

⚠️ The use of extensions requires being on a version of the package later than version 1.7. Please update the package via the AppExchange as required.

Use tag extensions in a table

Make amounts with the “SUM” tag

Add up the amounts of the same child object, a group or even hidden information and combine multi-currencies. This way, avoid formula-type fields in Salesforce and easily display subtotals.

  • After setting up a child object in Salesforce, opening the wizard, and placing your tag in your document template, add the extension (SUM) in your tag to add up the currencies or quantities: Ex. {! Product|Amount (SUM)}
  • Place the new tag where you want on your page using one of two options.

    Word configuration vs generation result

Limits
  • It is possible to display a SUM tag by itself if it is outside of a Word table (option 2)
  • A SUM tag is imperatively a tag on a child object
  • Multi-currency management is taken into account.
Count the number of records in the table

Cumulate the records of the child object to show the number of rows in a table or that meet a criterion entered in Salesforce.

  • After setting up a child object in Salesforce, open the wizard.
  • Access the tags for the desired child object.
  • Scroll to the bottom of the list of available tags and access the “Number of records” tag
  • Click on it to copy it and paste it where you want it to be on your page.
Limits
  • It is possible to display a COUNT tag in a table or outside a table.
  • A COUNT tag is imperatively a tag on a child object.

    Add up the amounts of the same child object, a group or even hidden information and combine multi-currencies. This way, avoid formula-type fields in Salesforce and easily display subtotals.

Manage “Rich Text” fields

By default, the Salesforce layout is applied to the content of a rich text field placed in a Word document at generation. Add one or more tag extensions to change these settings.

To apply the format applied to the tag in the Word template instead of the format used in the Salesforce field, you will need to use a tag extension to allow you to choose exactly the right format.

There are 5 types of formats that can be modified:
“f” for “font” = police
“s” for “size” = size
“c” for color = color
“t” for “type form” = character shape,
“i” for “indentation” = indentation

  • From the wizard, access the Rich Text tag you want to edit
  • Click on the 3 small dots on the right
  • Click on “Format Richtext”
  • Select the format to take from Word
  • Your tag is copied and can be pasted into your template with the following format: Ex: {! Account|Description (HTML,f, s)} for a case where I want to apply the font and size that is defined in the template

Manage images

Make sure to display the image exactly the way you want it

It is possible to display dynamic images when generating a document. Images can be stored directly in fields such as rich text boxes or URLs.

However, we recommend storing the image as a Salesforce file and then storing the Content Version ID on the record

  • In your document template, open the wizard to access the desired object
  • Find the rich text box or URL field that contains the image, or the text field that contains the content version ID
  • Click on the 3 small dots “...” then on Configure image
  • 💡 You can set a custom image size by changing the width and height, or keep the original size
  • Copy and paste the tag into your document
  • The tag then contains the img tag extension indicating that it is an image
  • For example:

    {! account|textfield__c (img)} in case you keep the original size

    {! account|textfield__C (img, w=30, h=15)} in case you define a custom size, with a width of 30 and a height of 15
Loading and testing the model
  • Go back to Salesforce and load the Word template with the image tag by clicking “Load version”
  • Make sure you have a test recording with an image

Partial display of a text field

Choose the number of characters in a field

The “Partial Display” feature will be very useful for truncating a text field.

  • If you want to show only a part of the field whose value returns 5A123 on the document, to show 5A on the one hand and to show 123 on the other hand, in another place on the document.
  • In this case, we will have to add to the first tag (0.2), the zero meaning that we are starting from the left and the two that we are taking the first two numbers. And (2, 3) to the second tag, to indicate that we want to take the last 3 digits from the 2nd character.


    We will use the tag {!obj|field (0.2)} = to return 5A and the tag {!obj|field (2, 3)} To return 123

⚠️ Attention
  • However, this feature is limited to text fields that contain only letters or numbers and whose total number of characters is known.
  • Ex: a product code field that always contains 5 characters.