This article outlines the new Insert functionalities within the Computed Items button in Open Office XML template (.docx). The Insert Computed Fields button allows you to make basic arithmetical operations with CRM-number fields.
Requirements: Available for DocumentsCorePack (DCP) for MS CRM 2013, v6.10 and higher. All our addons come with a 14 days free trial. Click here to download.
Important: The CRM fields must contain a number.
Figure 1: A possible result after using the math functions of the Computed-Fields functionality
OVERVIEW: The Computed Items button
The new Computed Items button contains the following new functionalities:
The Insert Advanced String Field button allows you to insert as many fields as you want in one single field.
The Insert Computed Field button allows you to make basic arithmetical operations with CRM-number fields.
Figure 2: Computed Items > Insert String/Computed field
Here is an example with predefined CRM-number fields.
Figure 3: Predefined CRM number fields
Please note: You can define other CRM fields to be number fields. For example, if you don’t need the Middle Name field in the contact entity and would prefer to type in a number, you can define the field to be a number field. If you did not define the field as a number field and tried to enter a number, you would see the following message box:
Figure 4: Message box – no number field
Step-by-step description on how to use the “Insert Computed Field” button
Step 1. Open the DocumentsCorePack Task Pane
You can find the new function in the DCP Task Pane. To get there, open an existing template or create a new one. Got to the www.mscrm-addons.com tab, click on Insert MailMerge Fields in the toolbar and create an Office Open XML (.docx) document by answering the question with Yes.
Figure 5: Open DCP Task Pane
The DCP Task Pane appears.
Figure 6: DCP Task Pane
Step 2. Choose the appropriate “Insert” functionality
Click on the Insert drop-down and choose the Insert Computed Field functionality.
Figure 7: Insert Computed-Fields
3. Add/Subtract/Divide/Multiply CRM number and money fields
In the next window, you have the ability to make basic arithmetical operations with CRM-number fields by inserting add +, subtract –, divide / and multiply * number fields with a double-click. You can also define a name for the field, for example, Invoice Dec. 213. If no name is typed in, the default name Computed Field will be set.
Figure 8: Add/Subtract/Divide/Multiply CRM number and money fields
Step 4. The result
If the calculation can be performed, you will see the result value in the merged document.
Figure 9: Result
If the calculation cannot be evaluated, you will see the resulting error in your document, as shown below. This might be the case if your calculation uses a string field that does not contain a number as a value.
Figure 10: Result – Error
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com.