When mapping fields from Dynamics 365 (Dataverse) you might need to show the data in a specific format (e.g. currency or date formats). This article outlines how to set the format of fields inside a DocumentsCorePack template.
.
Next to simply taking the format defined in Dynamics 365, custom format options can be directly set by via the “Field properties” from the “mscrm-addons.com”-ribbon.
Depending on the type of the field, different format options are provided:
- Number and money fields
- Date and Time fields
- Delete line/row if whole line/row is empty & Delete line/row if this field is empty
- Two Options & Option Set
- General Formatting in Microsoft Word
.
1. Number and money fields
Follow this step-by-step description to learn how to set the format of number and money fields.
Step 1: Open a Word document and navigate to the ❶ “mscrm-addons”-tab. Now place the ❷ cursor in the field you want to format. Click on the ❸ “Field properties” to open the options. In this example it is a detail from an invoice, where the currency needs to be adjusted to the country of the customer.
Figure 1: Open Field properties
Step 2: This “Field properties”-window will pop up. The section ❶ Field properties contain the
- Name (of the field) and the
- Relation
The section ❷ Formatting options offers the possibility to display the currency in the respective culture of the country. Learn more about Culture Information in DocumentsCorePack.
❸ “Use internal value”: When defining a custom format, it is required to ensure that the formatting is applied to the plain value (e.g., 10000 instead of the formatted value € 10,000.00). Hence, this setting is automatically checked when defining a format within the Field properties.
Figure 2: Field properties window
Step 3: Let´s have a closer look to the “Formatting options”. First you have to select the ❶ Culture so that the respective formats for this culture are displayed. Click on the drop down to select the one you want to apply.
Figure 3: Formatting options – Culture
Step 4: Then it is possible to choose the respective ❷ “Format” to the Culture. As you can see in Figure 4, all the “Standard Formats” are listed. After your selection, the result is displayed in ❸ “Example”. Now confirm with [OK].
Figure 4: Formatting options – Format, Example
.
2. Date and Time fields
This section shows the formatting options for Date / Time fields within the Field properties of the mscrm-addons.com-ribbon.
Step 1: In this example it is a detail from an invoice, where the date needs to be adjusted to the country of the customer. After placing the cursor in the respective fields and clicking the “Field properties” (Learn earlier how to access the “Field properties“), This window opens.
The section ❶ Field properties contain the
- Name (of the field) and the
- Relation
The section ❷ Formatting options offers the possibility to display the Date and Time in the respective culture of the country. Learn more about “Custom Date and Time Format Strings” in DocumentsCorePack.
❸ “Use internal value”: The box is checked, when you use the “Formatting options”, to take over individual formatting for this specific field and not taken from Dynamics 365.
Figure 2: Field properties window
Step 2: Let´s have a closer look to the “Formatting options”. First you have to select the ❶ Culture so that the respective formats for this culture are displayed. Click on the drop down to select the one you want to apply.
Figure 3: Formatting options – Culture
Step 3: Then it is possible to choose the respective ❷ “Format” to the Culture. As you can see in Figure 4, all the “Standard Formats” are listed. After your selection, the result is displayed in ❸ “Example”. Now confirm with [OK].
Figure 4: Formatting options – Format, Example
.
3. Delete line/row if whole line/row is empty & Delete line/row if this field is empty
To keep your documents compact, it is required to avoid empty lines within your documents.
Example: think of an address block where for some customers Address Line 2 is field, but for others not. To ensure a compact output you want to avoid empty lines.
There are two options:
- “Delete line/row if whole line/row is empty”: If the value of the selected field as well as all other fields within the same line are empty in DataVerse the line will be removed.
- “Delete line/row if this field is empty”: If the value of the selected field is empty, the whole line is removed independent on other content in the same line
How it works
Open a Word document and navigate to the ❶ “mscrm-addons”-tab. Now place the cursor in the field you want to format. Click on the “Field properties” to open the options.
If you need the row removed if the value of the selected field and all other fields within the same row in DataVerse are empty, take Option A.
If you need the whole line removed, if the value of the selected field is empty, take Option B.
Figure 5: Select Option A or Option B
Result:
.
4. Two Options & Option Set
For OptionSets (Two Options) the properties allow to either use the display or the internal value of the selected option.
“Use internal value”: When defining a custom format, it is required to ensure that the formatting is applied to the plain value (e.g., 10000 instead of the formatted value € 10,000.00). Hence, this setting is automatically checked when defining a format within the Field properties.
.
5. General Formatting in Microsoft Word
Word provides different options to format fields. The following article provides a very good overview on possibilities provided.
That’s it! We appreciate your feedback! Please share your thoughts by sending an e-Mail to support@mscrm-addons.com.