The DateTime option allows you to perform basic calculations with dates. You can add a certain amount of time to an existing date, or you can calculate the difference between two given dates. The following step by step description will show you how to insert a field of this type into your template.
We are glad to introduce the DateTime field with the DocumentsCorePack Client version 9.22 and DocumentsCorePack Server version 2017.174.
Step by step description
This description outlines how to add a DateTime field into a DCP template in your Dynamics 365 by using the given insert options.
This feature can only be used within DCP templates, so please open your existing template or create a new one before using this feature. (Here is a blog that explains how to create a new template)
Step 1: Open the “Insert Field“-dialog
After you successfully opened your template we can start to take a closer look at the modified Insert dialog. So please open the [Insert fields]-button and navigate to the “Computed items”-section ❶.
Within that section, you should be able to spot the new [DateTime Field]-button ❷.
Step 2: The “DateTime Field“-dialog
Please click on the [DateTime Field]-Button to open up the DateTime Dialog. This dialog gives you the possibility to specify your DateTime Field based on the given options.
Step 3: Build your calculation
Add your DateTime calculation to the pattern field.
The syntax for this field is described here.
In our case, we will add 5 days to the due date of a quote.
PLEASE NOTE: The layout of the dialog will change dependent on your used syntax.
You have the option to insert any field even if it is not a DateTime Field. Please do this at your own risk.
Step 4: Add a placeholder text [optional]
Setup a placeholder text.
❶ You can set a placeholder name for your field so you find it easier in case you have to modify your template in the future.
Step 5: Add formatting options
Since we have our Syntax configured we would like to define a format. This could be done by selecting one of the given options in the Unit Type or the Format and Culture dropdown.
The dialog provides us with different options for ❶ “DateTime“ and ❷ “Difference” (subtraction of 2 dates) results.
Based on this type we will have one of the two following dialogs.
Step 6: Insert the field
Now the DateTime Field is successfully defined. Click on the [OK]-button to insert it into the document.
Step 7: Save the template
The last and final step is to save your template. Before you can use or test your template you have to save it. Either you save your template locally with the standard “Save” or “Save” as a functionality of Word or you use the “Save template“-option of the DocumentsCorePack client in order to publish the template to Dynamics 365.
Step 8: Test your template [optional]
As you have made changes to your template you might want to test them quickly.
That´s it! We appreciate your feedback. Please share your thoughts by sending an email to email@example.com.