25. November 2011 13:11

How to add information of the current user to a document?

Filed Under(CRM 2011 | DocumentsCorePack 2011) By Michael Dohr

It is quite common, that user information shows up within the document itself. (e.g. a “Best regards, firstname lastname” at the end of a quote).
This Step-By-Step tutorial describes how to add this relation to a template. In this example the Quote_base.docx template, that comes with the installation of DCP for CRM 2011, is used.

Please note: DocumentsCorePack (DCP) Client version 5.27 or higher is mandatory!

...

Since DCP Client v5.27 it is possible to use so called predefined relationships. This means that it is possible to predefine relationships like quote->quote products or a relationship to the actual user in a global mscrm-addons setting.

Please note: in DCP server versions < v5.15, the settings for the actual user are installed by default.

If your server version is 5.15 or lower, please open CRM, navigate to Settings->MSCRM-ADDONS.com Products and open DocumentsCorePack:

image

Figure 1: DocumentsCorePack Settings

Once there, create a new “mscrm-addons.com”-settings key:

Keyname: DOCX_Global_Relationships
Keyvalue:
<relationships>
  <relationship>
    <mainentityno>8</mainentityno>
    <localization>
        <de>
            <headertext>Benutzerinfo</headertext>
            <detailedtext>Ermöglicht die Verwendung benutzerspezifischer Daten in Docx-Vorlagen</detailedtext>
        </de>
    </localization>
    <headertext>User Info</headertext>
    <detailedtext>Use all the fields from the logged&lt;br/&gt;on user in your document.</detailedtext>
    <fetchxml>&lt;fetch mapping='logical' version='1.0'&gt;
     &lt;entity name='systemuser'&gt;
          &lt;all-attributes /&gt;
          &lt;filter&gt;
               &lt;condition attribute='systemuserid' operator='eq-userid' /&gt;
          &lt;/filter&gt;
     &lt;/entity&gt;
&lt;/fetch&gt;</fetchxml>
  </relationship>
<relationship>
</relationships>

image 

Figure 2: New settingskey


Once this is done, simply restart MS Word and the DataProvider on the Client. Click on the [Insert Mailmerge fields]-button and switch to the Additional–tab. You will see the global relationships by expanding the New Relationship/Entity–entry.

image

Figure 3: DocumentsCorePack Task Pane - Additional tab


Once clicked, the fields of the user will be shown in the treeview:

image

Figure 4: DocumentsCorePack Task Pane - TreeView with user

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

Tags:

Tag Cloud

This will be shown to users with no Flash or Javascript.

Page List