This article describes how to define dynamic document names in DocumentsCorePack templates. The Document Name property allows you to define a name or a name pattern within DocumentsCorePack templates. Once defined, documents generated automatically will have an automatically generated specific name.
Example: You have a document for a Quote ID: QUO-01007-B9F71. If the document name property is defined as “Quote_<<quotenumber>>” the generated document will be named “Quote_QUO-01007-B9F71.pdf“. Thus, all fields from the Dynamics 365 record itself can be used within the document name.
If you are unsure how to gain access to the template settings to set the document subject, have a look at this article before continuing.
Step 1: Access the Document Name and Subject section
❶ Navigate to Document Name and Subject.
Step 2: Set your ❷ “Document Name Pattern”
Insert a field by double-clicking it in the tree or by typing in a fixed text enclosed by single quotes.
The basic rules for the syntax of this property are:
- Dynamics 365 fields have to be enclosed by <<and>>
- The fixed text has to be enclosed by single quotes (‘).
- Fields and fixed text have to be combined with a plus (+).
- You can display the name in upper case when using the upper function. Example: Document name: ‘Inv-‘+<<name>>.upper().
Details about the syntax for this property can be found here: DocumentsCorePack Property Syntax.
Step 3: Save your template
Before you can use or test your template, you must save it. You can save your template locally with the standard Save, Save as functionality of MS Word, or you can use the ❷ Save template option of the DocumentsCorePack Template Designer in order to publish the template to Dynamics 365.
Step 4: Test your template
A detailed description of how to quickly test your template can be found here.
- How to set the Document Subject
- List of available template settings
- How to format date fields in document names?
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com