This blog outlines how 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 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 fields] 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 ❷.
If you are not familiar with the [Insert Field]-button you can start your research here.
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.
Figure 4: Placeholder
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 we have successfully defined our DateTime-field and by clicking on [ok] it will be inserted 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 functionality of Word or you use the Save template-option of the DocumentsCorePack client in order to publish the template to Dynamics 365.
Test your template [optional]
As you have made changes to your template you might want to test them quickly.
A step by step description of how to test your template can be found here.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com.