• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/Template Designer(DCP)/How to format dates within a document name

How to format dates within a document name

674 views 0

DocumentsCorePack relies on string formatting to create document names. When the OVALUE option is applied to a field (e.g., <<field_ovalue>>), it returns the value of the field in the internal database format. For date fields, this would be formatted as follows:

yyyy-MM-ddThh:mm:ss+TIMEZONE
2018-09-27T16:16:28+02:00 

With the .pos option (See DocumentsCorePack Property Syntax), you can get a specific section of this string that should be displayed.

<<field>>.pos(StartingPosition, Number of Characters)

Based on this information, using this .pos option allows you to get the day, month, and year as separate strings into your document name. Learn more about how to define document names in DocumentsCorePack.

Example:

The Setting of the Example Document Name:

<<createdon_ovalue>>.pos(1,4) + ‘-‘ + <<createdon_ovalue>>.pos(6,2) + ‘-‘ + <<createdon_ovalue>>.pos(9,2)

And the result of the Example Document Name:

2018-09-27.pdf

.pos(1,4) is the year
.pos(6,2) is the month
.pos(9,2) is the day

Document name example for .pos option
Figure 1: Document name example for .pos option

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

Was this helpful?

Yes  2 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.