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!


Ofner Patrick
Ofner Patrick
Ofner Patrick's Blog

Configure RecordCounter for custom n:n relations

Please note: It is not possible to set up custom n:n-relations by using the tree view of the RecordCounter Server Config!

Instead, you have to use the Configuration Tool. To do so, click on the [Configure RecordCounter]-button to open it.

Figure 1: RecordCounter Server Config

The following window (Figure 2) will appear. First of all, you must add a new navigation-item to the list in the Navig Item-area. This can be done with a click on the [Add]-button

Figure 2: Record Counter - Configuration Tool

 

Figure 3: Add Navigation Item-window

 

To find out the right name for the entry, just follow these instructions:
Open a CRM-record, which includes the related entity in the navigation bar.
By pressing the [F12]-button (or Extras -> Developer Tools) the Developer Tool will appear.

Here, click on the cursor in the upper left area of the tool. After that, switch back to CRM and click on the menu item (for which RecordCounter should be configured). 
The html-code of that menu item will be displayed and highlighted in the Developer Tool. 
Now you only have to search through the highlighted selector for the attribute id. The value of the id is the name of the new config entry.

Figure 4: Developer Tool

The next step is to build your custom fetch.
The easiest way to build a fetch is by using a fetch generator, e.g. Stunnware Tools. Additionally, there is a solution available that allows you to execute a fetch directly from CRM. This can be very helpful for testing. The following article describes how this can be used: Link to article.

As main entity for the fetch, select the entity for which you want to enable the RecordCounter. In this case it is product. You must only add the id-attribute to it (productid).
Next, you have to add a link to the parent entity. In our example, we add Contact.

Finally, you have to add a filter and a condition. The reason for this condition is that only records linked with the current parent entity should be counted.
The attribute of the condition has to be the id-attribute of the parent entity. It is contactid in this case. For value type in [GUID]. The RecordCounter will replace it with the calling parent entity-id.

Example fetch:

<fetch mapping="logical" distinct="true" version="1.0">
    <entity name="product">
        <attribute name="productid">
            <li name="new_contact_product" from="productid" to="productid">
                <filter>
                    <condition attribute="contactid" operator="eq" value="[GUID]">
                    </condition>
                <filter>
            </li>
        </attribute>
    </entity>
</fetch>

 

Next, select your new navigation entry in the config and focus the Additional Fetches-area. Click on the [Add]-button

Figure 5: Record Counter Configuration Tool

Now the following window will appear. Include your fetch in the Fetch-XML-field.

And add the EntityTypeCode of the parent entity to Fetch-Type. In this example, the parent entity is Contact and its EntityTypeCode is 2.

Click on the [OK]-button in order to proceed.

Figure 6: Add Fetch-XML

With a click on the [Save]-button on the config, all settings will be saved and the configuration is completed.

Only if the RecordCounter doesn’t work for the new navigation entry, try to restart the Microsoft Dynamics CRM Sandbox Processing Service on the CRM server.

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


Configure RecordCounter for unmanaged custom entities

To successfully enable RecordCounter (RC) for unmanaged entities, please follow these instructions:

First, enable RC for the custom entity. Simply check the checkbox in the tree view of the RecordCounter Server Config.

Then open CRM, navigate to Settings and click on Customizations.

Figure 1: Open Customizations

 

Then click on Customize the System. Select your custom entity in the tree view and open the Main-Form. This example is made with the entity Account.

Figure 2: Publish All Customizations

Click on the [Form Properties]-Button then the following dialog will appear. First, you must add the RecordCounter library in the Form Libraries-section. This can be done by clicking on the [Add]-Button and select the ptm_LineItemCountOnload – web resource.

The next step is to focus on the Event Handler-section. Ensure that the Control-list box is set to Form and Event to OnLoad. Then click on the [Add]-Button.

Figure 3: Form properties dialog

 

The following dialog will appear.

Here, select the ptm_LineItemCountOnLoad-library. And fill in StartLineItemCount in the textbox next to Function.

Ensure that Enabled is checked.

Now you have nearly finished. You only have to click on the [OK]-Button.

Hit the [Save]-Button and publish the customization.

Figure 4: Handler properties dialog

Please note: When you decide to uninstall the product, those links have to be removed manually as well. They do not harm CRM, but will redirect to dead links, if you leave them in place.

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