mscrm-addons.com logomscrm-addons.com logo
  • Release History
  • Knowledge Base
  • Documentation
  • Contact Support
  • Release History
  • Knowledge Base
  • Documentation
  • Contact Support
home/Knowledge Base/Template Designer(DCP)/DocumentsCorePack DateTime Field Syntax (Dynamics 365)

DocumentsCorePack DateTime Field Syntax (Dynamics 365)

3875 views 1 Updated on June 22, 2023

The  DateTime Field  option of DocumentsCorePack (DCP) allows you to perform basic calculations on dates and times. This article describes the syntax that can be used for those calculations. 

The basic syntax: Fields from Dynamics are enclosed by “<<” and “>>” when you insert them from the tree view. 

Basic syntax
Figure 1: Basic syntax

The difference between two dates can be subtracted by using a “–”.

Difference between two dates
Figure 2: Difference between two dates

Functions on a date can be executed by adding a dot “.” and the function name including the necessary parameters. 

Function with parameters
Figure 3: Function with parameters

Supported functions and operators

Operator table

Operator  Name                
 Sign                                                                                                                                                                           Example 
Difference   –  <<duedate>> – DATETIME() 

For example, calculate an offer with a due date minus today´s date.  

Function table

Function  Description  Examples 
Add(value, unit)  Adds a numeric value to the current date.
The first parameter represents the numeric value that should be added.
The second parameter represents the unit.
Parameters for units are either: year, month, weeks, days, hours, minutes, seconds, milliseconds 
<<createdon>>.Add(10,year) 
 Subtract(value, unit)  Subtracts a numeric value from the current date.
The first parameter represents the numeric value that should be subtracted.
The second parameter represents the unit.
Parameters for units are either: year, month, weeks, days, hours, minutes, seconds, milliseconds 
 <<createdon>>.Subtract(10,year) 
Addbusinessdays(value)  Adds a certain amount of days to the current date.
Weekends (Saturday and Sunday) are excluded from this calculation. 
<<createdon> >.Addbusinessdays(10) 
Round(unit, direction)  Round allows you to modify a time value to the next or previous quarter, half or full hour.
The first parameter can display a quarter, half, or full hour.
The second parameter represents the direction. (up/down) 
<<createdon>>.Round(quarter,up)
<<createdon>>.Round(half,down)
<<createdon>>.Round(full) 
DATETIME()  This function returns the current date and can be used as a field paired with any of the above functions.  DATETIME().Add(5,days) 

Please note: You cannot join different parameters. If you would like to add days and months, please always use the lowest unit for your chosen parameter. For example, 1 Month and 15 Days would be 45 Days.

That´s it! We appreciate your feedback. Please share your thoughts by sending an email to support@mscrm-addons.com.

Was this helpful?

1 Yes  1 No
Related Articles
  • Debugging the Template Design Office Add-In 
  • Introducing the DocumentsCorePack Template Designer Office Add-In
  • Ensuring correct time zone display for DateTime fields
  • How to compare a date-fields with the current date 
  • Create a template for XML or plain text
  • E-Invoicing with DocumentsCorePack
Latest Articles
  • Locating Raw Inputs and Outputs in Power Automate
  • Step by Step: How to execute an OCA in a Power Automate flow 
  • The Hidden Cost of CRM Storage — And How to Eliminate It 
  • Recap: Nordic Summit 2025
  • The new Template Designer Office Add-In
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Application Access for Dynamics 365
  • How to find your environment’s unique name in Microsoft Dynamics 365
  • How licenses are counted
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • How to insert Condition Fields in DocumentsCorePack Templates designer
  • Important information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack Connector for PowerApps & Microsoft Flow
  • How licenses are counted
Categories
  • *News and General Infos* 65
  • Webinars 46
  • Template Designer(DCP 197
  • DocumentsCorePack(DCP 262
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 76
  • PowerSearch (PS 50
  • ActivityTools (AT 61
  • SmartBar (SB 54
  • GroupCalendar (GC 47
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2025 www.mscrm-addons.com. All Rights Reserved.