mscrm-addons.com - Blog

IMPORTANT INFORMATION

This blog is deprecated since July 2020.The articles below are no longer maintained and might contain outdated information. 
You can find the most acutal and relevenat information in our Knowledge Base at support.mscrm-addons.com

News.mscrm-addons.com Blog

rss

Hello and welcome to our blog! What can we do for you? Are you looking for further technical information or step-by-step instructions to our products? Or would you like to read the latest news on mscrm-addons? Please feel free to browse our blog for detailed information and to share our posts!


Bäck Martin
Bäck Martin
Bäck Martin's Blog

CreateActivitiesFor: Advanced Settings

This feature extends the existing CreateActivitiesFor-property of DocumentsCorePack.

This article covers the configuration, an example and the technical details of this feature.

To take adavantage of this feature, you need at least the following version of DocumentsCorePack:

 - DocumentsCorePack Client for MS CRM 2011 v5.76

The configuration options allow template editors to define 

  • Recipient 
  • Regarding
  • Save-location  

of activities based on a template independently.

 

Configuration

The configuration of this feature requires a proper configuration of the DocumentsCorePack Server and you need to understand the fundamental CRM 2011 capabilities. 
For example, an entity that does not have an enabled save location can be set as a save location but will end up in an error message. 
An entity that does not allow activities can not be set as recipient or regarding. This configuration will also end up in an error message.

Anyway, to access the Advanced Settings, open an existing template or generate a new one.

Then navigate to mscrm-addons.com (1) > click on the [Insert MailMerge Fields]-button (2) > open the Template Settings-tab (3) 
> click on CreateActivitiesFor (4) > click on Advanced Settings... (5).

 
Figure 1: Open CreateActivitesFor Advanced Settings

Here you can select the the Recipient, Regarding and the SaveLocation for the template.
The options which can be selected for each area are displayed in a tree view.
You can insert the required relation by clicking on the nodes and by double clicking on the correct option. 


Figure 2: CreateActivitiesFor - Advanced Settings

 The configuration is set for a quote template and has the following effects:

  •  The Recipient of the generated activity will be the primary contact of the parent account of the quote.
  •  The Regarding will be set to the quote directly.
  •  And the generated document will be saved to the configured location fo the parent account of the quote. 

The example below shows the outcome of the configuration for this quote template in more in detail.

 

Example 

 The quote AA_Bikes with the parent account MSCRM-ADDONS.com has a primary contact named Christian Ternek.


Figure 3: Example

After saving this template, you can continue to create a document, either directly from Word by using the [Select CRM Data]-button or by using the [Print in Word]-button within CRM.
Once done so, you get a merged document.

In case of further document processing, you can use the [CreateCRMActivity]-button and, e.g. generate a letter activity.
This process saves our generated document in the folder of the account (MSCRM-ADDONS.com) and defines the regarding to the quote (AA_Bikes).
The recipient is the primary contact of the parent account of the quote (Christian Ternek). 


Figure 4: Further document processing, eg. generation of a letter activity

 

Technical details

The third option (SaveLocation) also works for our AutoMerge addon (version 5.25 and higher).

The option to define the Regarding and the Recipient are not available in AutoMerge as they can be set directly within the workflow.

The options effect the Create CRM Activity-, the Save as...- as well as the Send as PDF-functionality of the DocumentsCorePack Client.

The outcome when selecting the Create CRM Activity-functionality is described in the above example.

The outcome when selecting the Send as PDF-functionality is the same. 

When you select the Save as...-functionality, the recipient and the regarding-property are ignored. It only saves the generated document to the proper location that is configured with the DocumentsCorePack Server.


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

 


[Save as DOCX]-button

This  feature offers you the option to save a document directly to the proper location in CRM without having to generate an activity. 
The location depends on the configuration, which is defined within the DocumentsCorePack server configuration tool.

To take adavantage of this new feature you need at least the following version:

 - DocumentsCorePack Client for MS CRM 2011 5.73

Specification

The Save document-feature is an additional button in the www.mscrm-addons.com-tab (see Figure 1).

The button enables you to save a merged document to a specific location without having to generate an activity.

The document can be saved in various formats, directly form the drop down menu. The button itself saves the document as a Microsoft Office Word Open XML document (docx).
Document types that are supported by Word, but are not listed in the menu can be selected with the Save as...-option.


Figure 1: www.mscrm-addons.com-tab with [Save as DOCX]-button

DocumentsCorePack template properties like DocumentName, CreateActivitiesFor and Save-To subfolder(s) affect the location and the name of the document when using this feature.

Please note: Directly after the merge, the document might only have a generic name (e.g. Result1223473.docx). The DocumentName property will be applied as soon as you use the [Save as DOCX]-button.

If no DocumentName poperty is set,  the name that is displayed in the header in Word (e.g Document1, Result1223473.docx) will be used in the save document location.

 

Configuration

If you to enable/disable this feature, you may change your DocumentsCorePack Settings.

To access to the settings dialog, open Word and navigate to the www.mscrm-addons.com-tab > DocumentsCorePack Settings > General.

In the so opened settings, you may configure the [Save Document]-button by checking/unchecking the checkbox next to

'Save Document' - Button visible


Figure 2: DocumentsCorePack Settings

 

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

Advanced template-group filtering

This feature offers the possibility to set a filter for DocumentsCorePack templates.
Templates are filtered based on the template-group they are assigned to.
Applying filter limits, the available templates are grouped in template-groups.
This prevents users from getting confused by a variety of available templates as they can only see and select templates of the corresponding template-group defined by the applied filter.

To take advantage of this feature you need at least both of the following versions:

 - DocumentsCorePack Server for MS CRM 2011 5.36

 - DocumentsCorePack Client for MS CRM 2011 5.73

Specification

DocumentsCorePack templates can be organized in groups.
These groups are displayed as separated tabs in the Open Template-dialog and are also available as sub-items in the [Print in Word]-button.


Figure 1: DocumentsCorePack template groups - examples

To improve the DocumentsCorePack-usability for end-users, you can set a filter for these template-groups in the DocumentsCorePack server configuration.
Applying this filter limits the available templates in the template selection menu of a CRM record to just one specific template-group.
So users will not get confused because of a variety of available templates as they can only see and select templates of the corresponding template-group defined by the applied filter.


Figure 2: Filtered DocumentsCorePack template groups

Figure 2 displays the field that contains the filter criteria (attribute) for this record (GroupFilterText-field at the bottom on the right side).
In this example, only templates of the template-group Group B are displayed and can be selected within the [Print in Word]-button.

Please note: This feature only works for single records and does not apply to bulk merges of documents, because different records may have different filter criteria!

Configuration

Start the DocumentsCorePack Server Configuration Tool and click on the [Advanced Template Group Filtering]-button below the Print in Word entity selection window.

A new window opens. This window displays all entities that have been configured to show the [Print in Word]-button. 

Now you have the possibility to configure the feature for the template-group filtering.
To do so, select the entity that should be used to filter the template-groups.
Now select a text attribute for the selected entity. For example: The configuration shown in Figure 3 enables the filtering process for the entity Account based on the value of the attribute GroupFilterText which is defined within each CRM record individually.


Figure 3: Filtering process for the entity Account 

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

[Print in Word]-button

The features of the DocumentsCorePack [Print in Word]-button increase the performance and also the usability of our product.

The features allow you to select templates directly with the [Print in Word]-button.

To take adavantage of this feature you need at least the following version:

- DocumentsCorePack Server Version 5.25

- DocumentsCorePack Client Version 5.57


Figure 1: [Print in Word]-button

 

Please note: If you want to use these features it is VERY IMPORTANT that all users work at least with Client version 5.57, otherwise they will not be able to take advantage of the new features.

Please find all DocumentsCorePack versions in our Download Section

Features: 

Enable Template selection from ribbon/Use hierarchical menus

Once the Enable Template selection from ribbon and Use hierarchical menus-features are set, they split the [Print in Word]-button.


Figure 1: DocumentsCorePack Server Config

The top of the button starts the merge as usual. The template section must be operated with the [Open Template]-button.


Figure 2: [Print in Word]-button (top of the button)

The lower part of the button will drop down a list with all available templates for this entity.


Figure 3:Print in Word-button (lower part of the button)

If you have only checked the Enable Template selection from ribbon-option in the DocumentsCorePack Server Config, 
the drop down list shows all available templates (even if the templates are stored in different groups).


Figure 4: Enable Template selection from ribbon

If the Use hierachical menus has been configured as well, the template-groups are displayed hierachically.
The templates that are stored in the General-group will be displayed on top of the list.

Figure 5: Use hierachical menus

Adv. Ribbon

This configuration allows you configure different names in different languages for the [Print in Word]-button.
Furthermore, you are enabled to define specific icons for the buttons in CRM.


Figure 6: Ribbon ressources-editor

With the editor, different labels for the different locations (Grid, Form,...) can be set in different languages.

The Icons-tab of the editor enables you to change the the icons of the buttons. The icons are a CRM webresource you can upload by yourself using the standard CRM functionality.


Figure 7: Edit ribbon resources 

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

CustomPrintInWordActionAccount

The below-described methods are part of the ptm_dcp_custombuttonactions.js-web resource. More information on this resource can be found here. If you are using Dynamics 365, please also have a look at this article here

The comments and the code for one example of this resource are added below.

Basically, this example is already ready to use. At line 52 you will see the method call that contains the template name (Account Reconnect.dot). This is a standard template which is installed during the installation of DocumentsCorePack.
If you want to change it to a different template, you simply have to change the name. The GUID for this template is retrieved with a helper method that is part of the web resource

If you are creating additional functions for other entities, we recommend keeping a similar naming convention like ours. For example, CustomPrintInWordActionLead for leads, because users could get confused and also cause problems with the DocumentsCorePack Client if you use a method that contains a template which cannot be used with this entity. Basically, a specific template can only work for a specific type of entity.

Global variable:

// This variable is for the registry value which holds the selected ID's
// and the selected entity typecode. DON'T change this format of the
// string! Otherwise DocumentsCorePack Client will not work.
var writeToReg;

This is the CustomPrintInWordActionAccount example:

//--------------------------------------------------------------------------//
//
// This is a sample of how a basic method should look. When you click the 
// Print in Word button from the CRM Grid, the three parameters are defined.
// If you click the button from the Entity Form, the parameters will be
// undefined.
//
// selectedIds:     The unique ID's of the selected records in the grid
// typeCode:        The entity type code of the selected entity
// entityName:      The entity logical name
//
// --------------------------------------------------------------------------//
function CustomPrintInWordActionAccount(selectedIds, typeCode, entityName)
{
    try
    {
        // BLOCK WHICH SHOULD NOT BE CHANGED START
        
        // we're starting from grid view
        if (selectedIds != undefined && selectedIds.length > 0)
        {
            try
            {
                // this for-loop builds the registry value when starting from grid                
                for (var i = 0; i < selectedIds.length; i++)
                {
                    var tmp = "?id=" + selectedIds[i] + "&oType=" + typeCode + ";";
                    writeToReg = writeToReg + tmp;
                }
            }
            catch (err)
            {
                showJsError(err.number, err.description);
            }
        }
        // We're starting from the entity record form
        else
        {
            entityName = Xrm.Page.data.entity.getEntityName();

            // This builds the registry value when startnig from the entity form
            var oType = crmFormSubmit.crmFormSubmitObjectType.value;
            writeToReg = "?id=" + Xrm.Page.data.entity.getId() + "&oType=" + oType + ";";
        }
        // BLOCK WHICH SHOULD NOT BE CHANGED END


        // You could optinally retrieve a template id by the template name
        // In this example the Account Reconnect basic template will be retrieved
        // You have to specify a callback method whenn the template id is retrieved
        // In that callback method you'll run the merge
        retrieveTemplateIdByName('Account Reconnect.dot', entityName, CustomPrintInWordActionAccountTemplateRetrievedCallBack);

        // If you don't want to retrieve the template by name, you could directly specify
        // the unique template id. Then you don't have to create a callback method and can
        // run the merge direct in this method.

        // This line initates the DocumentsCorePack Print in Word ActiveX
        // var printInWord = new ActiveXObject('PrintInWordActiveX.PrintInWord');

        // You could set the TemplateId to let DCP open a specific template
        // This property is optional
        // printInWord.TemplateId = UNIQUETEMPLATEID;

        // reset the reg variable
        // var registryValue = writeToReg;
        // writeToReg = '';

        // now you start the Print in Word and DCP generates the document
        // with the optionally specified template
        // printInWord.Print(registryValue);
    } catch (err)
    {
        showJsError(err.number, err.description);
    }
}

Here you can see the corresponding CallBackMethod: (CustomPrintInWordActionAccountTemplateRetrievedCallBack)

// -------------------------------------------------------------------------- //
//
// This is the callback method for CustomPrintInWordActionAccount to retrieve the
// template id. This method is called when the template id was retrieved via REST
//
// -------------------------------------------------------------------------- //
function CustomPrintInWordActionAccountTemplateRetrievedCallBack(result, textStatus, request)
{
    try
    {
        if (result != null && result != undefined && result.length > 0)
        {
            //get the template id from the result
            var templateId = result[0].ptm_mscrmaddons_dcptemplatesId;

            // This line initates the DocumentsCorePack Print in Word ActiveX
            var printInWord = new ActiveXObject('PrintInWordActiveX.PrintInWord');

            // You could set the TemplateId to let DCP open a specific template
            // This property is optional
            printInWord.TemplateId = templateId;

            //reset the reg variable
            var registryValue = writeToReg;
            writeToReg = '';

            // now you start the Print in Word and DCP generates the document
            // with the optionally specified template
            printInWord.Print(registryValue);
        }
    } catch (err)
    {
        showJsError(err.number, err.description);
    }
}

 

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


Advanced [Print in Word]-Button Configuration

Basically, the default [Print in Word]-button contains JavaScript code in the background.

If you are familiar with CRM and JavaScript you can add your own custom buttons to increase the usability of your CRM system. If you are using Dynamics 365, please also have a look at this article here

e.g., you can predefine a template that should be always used to perform the merge. 

You can modify the JavaScript code, so that - based on certain criteria - a template is automatically selected without user interaction.

The following article contains a description of how to change, modify and extend this feature.

First of all, to get access to the Advanced Button Configuration, you have to start the DocumentsCorePack Server Configuration Tool.

On the bottom of the General-tab, you will find the [Advanced Button Configuration]-button.


Figure 1: DocumentsCorePack Server Config General tab

When clicking on this button, the Advanced Button Configuration-dialog appears. 


Figure 2: Advanced Button Configuration

In this dialog, you can select the entity that you want to manage.
E.g. Already existing custom [Print in Word]-buttons will be listed and can be deleted.

If you press the [Add]-button, the following Edit button-dialog apprears.


Figure 3: Edit Button dialog

The Add-functionality gives you the possibility to define a custom name for your button and you can select
the JavaScript function that should be executed if you hit the generated button.

The DocumentsCorePack Configuration Tool already includes a few Javascript-templates you can use to get started.

The following functions are predefined:

- CustomPrintInwordActionAcount

- PrintQuoteWithSpecificTemplate

With a click on the [Modify JavaScript]-button the JavaScript webresource (ptm_dcp_custombuttonactions.js) is opened in a new CRM window. 

The CRM window allows you to see the detailed JavaScript code by clicking on the [Text-Editor]-button.


Figure 4: JavaScript webresource-window

The prefabricated JavaScript contains a comprehensive in-line documentation.


Figure 5: Prefabricated JavaScript

Another example that is part of this webresource can also be found here with some additional information. 

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

How to enable debugging - Overview

Please select the product and CRM version form the table below and follow the link to get redirected to a description of how to debug.

Product

CRM 

 Version

 

2011

2013 and 2015/2016

 MS Dynamics 365

SmartBar

x

Click here

 Click here 

 

 

RecordCounter

Click here

x

 x

 

 

TelephoneIntegration

Click here

Click here

 Click here 

 

 

 

 

PowerSearch

Click here

Click here

 Click here 

 

 

GroupCalendar

Click here

Click here

 Click here 

 

 

DocumentsCorePack Client

Click here

Click here

 Click here 

 

 

DocumentsCorePack Server Based

 

 

 

ON PREMISE/IFD

x

Click here

 Click here 

ONLINE

x

Click here

 Click here 

 

 

 

 

AutoMerge

Click here

x

 x

 

 

 

 

AttachmentExtractor

 

 

 

 ON PREMISE/IFD

Click here 

Click here 

 Click here 
 Online  x   x  Click here 
       

ActivityTools

Click here

Click here

 Click here 


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

 Click here 
 Click here 
 Click here 


DocumentsCorePack template security settings

In CRM 2011, all DocumentsCorePack templates are stored in custom entities.
The name of this custom entity is DocumentsCorePack Template (ptm_mscrmaddons_dcptemplates).
Every record of this entity has the template attached as a note.

You have got the possibility to modify the access privileges by adjusting the CRM permissions for CRM users of this custom entity.

 


Figure 1: DocumentsCorePack template security roles

Documents Core Pack adds a custom security role to your CRM with the name DocumentsCorePack Security Role. This role is added to every user after installation.

If you are going to modify an existing role, or if you are going to create a new role to restrict the template permissions, please make sure that the following privileges are set as well.
Otherwise, problems while running DocumentsCorePack could occur.

 

Permissions required to grant DocumentsCorePack running trouble-free

Plug-in Assembly: READ
Plug-in Type: READ
Sdk Mesasge: READ
Sdk Message Processing Step: READ
Sdk Message Processing Step Image: READ


Figure 2: Minimum permissions required

Permission required when working with SharePoint

This permission is necessary if you use DocumentsCorePack with the CRM integrated SharePoint solution.

Document Location: READ


Figure 3: Permissions required when working with SharePoint

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

DocumentsCorePack Client save locations
There are three major save locations for files that are used by the DocumentsCorePack Client.

 
1. The installation directory

The installation files of DocumentsCorePack can be found here:
C:\Program Files\PTM EDV-Systeme GmbH\Documents Core Pack Client for MS CRM 2011.
(or C:\Program Files(x86)\PTM EDV-Systeme GmbH\Documents Core Pack Client for MS CRM 2011 depending on your Windows and Office version)
If you have changed the installation path during the installation process you will find the files there.
This directory contains the needed assemblies and rescources.
Please note: Never ever delete, change or modify any files in this location.  
 
2. The application directory
The application data location can be found here: %APPDATA%\DCP
The location above is equal to C:\Users\[YourUsername]\AppData\Roaming\DCP.
This location can contain volatile subfolders and documents. 
The most important subfolder here is called metadata.
This folder contains the metadata information of your CRM organization(s).
(Click here to learn more about How to change the metadata location)
 
3. The temporary directory
The application data location can be found here: %TEMP%\DCP
The location above is equal to C:\Users\[YourUsername]\AppData\Local\Temp\DCP
This location contains temporary files like e.g. downloaded templates.
The most important subfolder in this location is the subfolder log, which contains debug files if debugging is enabled.
(Click here to learn more about How to enable debugging for DCP)
 
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.

How to change the save location of the metadata.bin file

Per default, CRM metadata information for DocumenstCorePack is stored here:

%APPDATA%\DCP\metadata

The above location equals to C:\Users\[YourUsername]\AppData\Roaming\DCP\metadata.
If you want to change this location, you have to generate a new SettingsKey.

Click here to learn how to create a new SettingsKey.
 
The name of the key has to be "CommunicateToMSCRMFolderLocation" and as a value you must set a path, e.g. "c:\TEMP\" or "\\fileshare\TEMP"
 
Please note: This new key will affect all DocumenstCorePack Client installation! So you have to make sure that each DocumenstCorePack Client user has access to provided path!
 
Please note: The DocumentsCorePackDataProvider must be restarted on the Client afterwards!
 
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.