This blog article covers a Step-by-Step example on how to set up user-prompts in DocumentsCorePack Template Designer.
Prompts enable the user to add or modify document elements without opening the document. The additional options for prompts are displayed in an additional window of the DocumentsCorePack dialog.
Figure 1: Prompts within the DCP Dialog
The following steps contain a description of how to set up such prompts in your templates.
Step 1: Create a Prompt
A prompt is defined in a template within the advanced template settings. To access the prompts settings navigate to ❶ “Insert MailMerge Fields” to open the DocumentsCorePack Taskpane. Go to ❷ “Advanced Template Settings” and select ❸ “Prompts”.
The Prompts-Editor allows you to ❶ create, ❷ edit and ❸ delete prompts. Also, the ❹ sort order of how the prompts should appear can be modified as well.
Step 2: Add a prompt
You can add a prompts by using the add button. Each prompt requires a name (special certain chars are not allowed).
There are 3 different types of different prompts that you can select:
- Text (as single or multiline)
A text allows the user to enter additional text in the DCP dialog that will be added to the generated document.
A text prompt can be a simple single line of text or also a text box by using the allow line breaks option.
By setting the required checkbox you can define if a user has to enter data.
A checkbox prompt enables you to either add or remove optional content in the document.
A checkbox is by default mandatory.
A select prompt enables you to keep only one specific section, out of several setup blocks in the document.
Each prompt also requires at least one label. A label is a text that is displayed in the DocumentsCorePack Dialog in front of the actual control (see Figure 1). If a label for the current user language in Dynamics 365 is set this translation will be displayed. If there is no label that matches the current user’s language, the first one in the list is displayed.
After you have set up the prompts in the settings, you are able to insert them into your document.
Step 3: Insert a prompt in your document
You will find an additional selection in the “Insert Field” -> “Computed Item” -> ❶ “Prompt Field”. Each entry represents a prompt that you have created previously.
A ❶ text box does not require any further septs as it will be replaced with the text entered by the user. For prompts of the type ❷ checkbox and ❸ select, you will have to replace the current placeholder text with your desired content.
Figure 7: Template before and after replacement of placeholders
Step 4: Save your template
Before you can use or test your template you have to save it. Use the -option of the DocumentsCorePack client in order to publish the template to Dynamics 365.
Please Note: Prompts do not work with the Template Designer, only by using the DocumentsCorePack Server Dialog (“Create Document”).
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to firstname.lastname@example.org.
#reworkneeded.. found multiple article about this .. merge them or reference it