• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/Template Designer(DCP)/DocumentsCorePack DateTime Field Syntax (Dynamics 365)

DocumentsCorePack DateTime Field Syntax (Dynamics 365)

3634 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
  • 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
  • How to add content from SharePoint to a document
  • Using MS Word field codes in DocumentsCorePack templates
Latest Articles
  • Document Generation via Copilot in Dynamics 365 Sales using DocumentsCorePack
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Recap: ColorCloud 2025
  • Configure DocumentsCorePack within custom pages
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
  • 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
  • How to insert Condition Fields in DocumentsCorePack Templates designer
Categories
  • *News and General Infos* 62
  • Webinars 45
  • Template Designer(DCP 196
  • DocumentsCorePack(DCP 251
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 72
  • 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
  • © 2022 www.mscrm-addons.com. All Rights Reserved.