• 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)

1666 views 1 Updated on March 3, 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. 

The DateTime fields.
Figure 1: Fields

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

A sample difference between two dates function.
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. 

A sample function with parameters.
Figure 3: Function with parameters

  • Supported functions and operators:
Operator  Name                
 Sign                                                                                                                                                                           Example 
Difference   –  <<duedate>> – DATETIME() 

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

Figure 4: Operator 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) 

Figure 5: Function table 

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  No
Related Articles
  • Working with Product Properties in DocumentsCorePack
  • How to work with the Relationship Manager
  • Using virtual tables in DocumentsCorePack
  • DocumentsCorePack Template Designer Settings
  • How to solve: Failed to connect to an IPC Port
  • How to solve: Failed to connect to an IPC Port
Latest Articles
  • Working with Product Properties in DocumentsCorePack
  • How to work with the Relationship Manager
  • Using virtual tables in DocumentsCorePack
  • DocumentsCorePack Template Designer Settings
  • How to solve: Failed to connect to an IPC Port
Popular Articles
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • DocumentsCorePack Template Designer – Getting Started
  • mscrm-addons.com Application Access for Dynamics 365 (App Access) – DocumentsCorePack
  • DocumentsCorePack Online Service Configuration
  • Step-by-Step: How to configure a One-Click-Action
Top Rated Articles
  • IMPORTANT information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • Step-by-Step: How to configure a One-Click-Action
  • Online Services: Required Application Permissions
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
Categories
  • *News and General Infos* 51
  • Webinars 35
  • Template Designer(DCP 180
  • DocumentsCorePack(DCP 191
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 62
  • PowerSearch (PS 48
  • ActivityTools (AT 59
  • SmartBar (SB 53
  • GroupCalendar (GC 46
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.