DateTime fields allow you to perform basic calculations with dates. You can add a certain amount of time to a current date or calculate the difference between two. The following step-by-step description will show you how to insert a field of this type into your template and give a general overview of its features.
Please note: If you want to insert just the current date, please use the Advanced String field instead.
Step-by-step description
Step 1: Open the ❶ Insert Field menu and navigate to the ❷ Computed Items section. Within this section, select the ❸ DateTime Field button.Step 2: The DateTime Field properties will open. This dialog box allows you to specify your DateTime Field based on the options provided.
Step 3: Add fields to the pattern via the ❶ Property Designer or via the ❷ Text property designer. You can add a field either by ❸ double-clicking on the tree view or by ❸ searching for it. In the Property Designer, fields can be dragged and dropped where appropriate. When adding a field via the Property Designer, right-clicking on the field will display the ❹ functions you can use with it. These ❺ functions are:- Add (value,unit)
- Subtract (value, unit) (Note: choosing this function will alter the formatting options – see Step 5)
- Add Business Days (value)
- Round (unit, direction)
Note: If the formula isn’t displaying correctly, the window can be enlarged to ensure the entire input is displayed.
Alternatively, you can manually enter fields and functions in the ❶ Text property designer.Note: The syntax for the Text property designer is described here.
Step 4: ❶ Placeholder Text can be set to allow your field to be more easily found in the event the template must be modified in the future.Step 5: Formatting options are shown at the bottom of the window. When applied, the resulting date will be formatted based on the values defined in the Format and Culture dropdowns.
Note: Learn more about custom date and time formatting strings here. For culture formatting strings, see this link.
The formatting options will change depending on if ❶ standard formatting is being applied, or if the entered dates are being ❷ subtracted. If the difference between dates is being found, then the formatting options change to what is shown below on the right.Step 6: Insert the field by clicking OK. This will add the field to the document.
Step 7: Save and test your template. The template can be saved locally with the standard Save or Save as functionality of Word, or through the Save template option in DocumentsCorePack to publish the template to Dynamics 365. The template can be tested by following the steps found here.
The result of our merged field is shown below.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.