D365 No Code TIP : Capture Stage duration in Business process flows

With D365 V 8.2.2 onwards, new entities have been introduced for business process flows to capture the stage start date, end date, completed on and the complete duration to finish the entire process. However, many a times it’s a need to specifically measure the aging time of an opportunity or a case in each stage as it helps to pin –point and resolve specific bottle-necks in the sales and service process.

Here is the way to do so and get better analytical Sales Leaderboard charts as below to identify process glitches and rank the performance of your Sales/Services Team.


Hence, in this blog, I would be improvising on a no code solution to tackle this problem statement effectively and generate charts that help gauge your Sales/Service Team better. To begin with, firstly I would like to thank the Learning Reference Blog for coming up this wonderful approach towards capturing stage duration of each stage.

The approach remains the same here, to create an entity as an Activity entity and then workflow on the respective business process entity. I have used the OOB fields for Actual Start, Actual End Dates and calculated fields for calculating duration in minutes and days for reporting and charting purposes. Have named the activity entity as “Stage Change Movement” and worked on the out-of-box Lead to Opportunity Sales Process.

For better usability purposes have kept all fields read-only so that the users cannot modify them.


Here is the revised workflow as with the previous workflow as mentioned in the blog for reference, all the stage durations were being captured except for the last stage.

The revision here is to modify the wait condition and add a conditional branch to check if the business process is in-progress or has finished the cycle.

The workflow still triggers for the respective business process entity and when the process is applied change of Active Stage. The Create step for the activity Entity also remains the same.



The revisions to the workflow are as below. Modify the Wait condition, add the conditional branch and the respective update activity steps as stated below.


There you go, your solution is ready by activating the workflow here!


Tip D365 V9.0: Handy Bookmark for Getting record GUID

Hello All, there have been much a times when we need the GUID of a particular record in CRM. And each time we need this, most of us end up using browser Developer tools/JavaScript Alert to fetch and copy this information.

This easy to use javascript bookmark would help you to get:

1. Entity GUID

2. Entity Logical Name

3. The current record name (OOB name field)

with a click of a button which you can easily copy and paste.

So here is what you need to do:

Step 1: Open your Web Browser and navigate to developer tools/F12

Step 2: Navigate to console and execute the below code snippet:

javascript : (function() {window.prompt(‘All About This Entity Record: ‘,frames[0].Xrm.Page.data.entity.getEntityReference().entityType + ”  ” + frames[0].Xrm.Page.data.entity.getEntityReference().id + ”  ” + frames[0].Xrm.Page.data.entity.getEntityReference().name)})();

Here is what you see next:


Now you can simply copy paste these values!!

Could have been better if you could bookmark this, but wasn’t able to add this. Sad smile 

Let me know incase you can!

CRM 2015/2013 ER Diagram Generator Tool

Many of us have the need to document ER Diagrams (Entity Relationship Diagrams) as a part of our MS Dynamics CRM implementation.
Creating these ER Diagrams is one part, and formatting, color coding etc. these diagrams is another which thereby increases the documentation time as well. Sometimes this activity can be erroneous as well as we need to open each and every entity customization, browse through all the 1:N, N:1 and N:N relationships and then put them in the diagram as well.

So, here is the tool which would take care of all the above activities. The tool is simple to use and gives Sure Step color coded ER diagrams using MS Visio as the one shown below.


This tool is simple to use and gives Sure Step color coded ER diagrams using MS Visio. Here is the tool can be downloaded from CodePlex and below are the steps for using this tool.

Download the tool from here

Step 1: Once you unzip the solution. The tool can be run by clicking the “XRMERDiagGenerator.exe” file.


Step 2: After the tool comes up, you would have to connect it to a CRM organization by clicking “Sign in to CRM”. At this point you would get a pop-up to connect to a MS Dynamics CRM On-premise/ Online environment. This control would be familiar to most of us working with MS Dynamics CRM. Once a connection is made, you would be able to select and connect to your desired Organization.


Step 3: You would get a screen as below showing your connection information and suggesting to click the “Get All Entities” button. Now at this time, the tool would be fetching all the entities present in your selected organization so that its easy for you to select your required entity/entities and generate ER Diagrams for them.

Since a Metadata call is a costly operation in CRM, this operation would take sometime approx. 5-10 minutes.


Step 4: Once the List of entities are load, you can sort them by clicking the “Entity Schema Name” header. You can select all the entities or undo your selection by clicking the “ Select All” and “Select None” buttons. You can also select one or multiple entities by using the “Ctrl” key while selecting the entity rows.


Step 5: Now click “Generate Visio”, to generate the ER Diagram for the selected entity/ entities in MS Visio.


The “.vsd” file would be generated in the tool’s directory itself. Here is one sample ER diagram as created in MS Visio by this tool.


Pre-requisites for the tool:

1. You should have MS Visio installed in the system where the tool is running. Link for downloading a trial version for downloading MS Visio 2013 is here.

2. You should have .Net Framework 4.5 installed on your system. Although I haven’t checked out my tool on a system that doesn’t have .Net Framework 4.5 installed, but I think it should be there for my tool to run successfully. Link for downloading .Net Framework 4.5

3. You should also have Windows Identity Foundation installed and enabled in your system. Link for downloading Windows Identity Foundation.

Color coding for the Entities is as follows:

1. If the attribute is a primary key for the entity, then “[PK]” would be appended to the attribute.

2. A Business owned entity would be colored “Orange

3. An Organization owned entity would be colored “Green”.

4. A User/Team owned entity would be colored “Blue

5. If the entity does not fall into any of the above categories then would be colored “White”.

CRM 2013/ 2015 : Performance Analyzer Tool

I hope many of you would be knowing this, but just thought to share this as a refresher at the end of the year. With the release of Dynamics CRM 2013 SP1, Microsoft has introduced an analyzer to track performance on CRM form and view Loads.

This tool is an efficient one as we do not need to rely on the traditional Fiddler Tool to analyze the performance bottle necks of the CRM page. Its simple to use and provides detailed statistics.

We need to follow simple steps as below to take advantage of this feature.

Step 1: Open a CRM Form. For example you can open an account form.

Step 2: Then using your keyboard select Ctrl + Shift + Q to view the performance analyzer. The analyzer window as shown below would come on top of your browser.


Step 3: After this we need to “Activate” this utility. In order to activate this utility click on the “Enable” button as highlighted above in the screen shot.

Step 4: Then using F5 refresh your CRM form, the utility will close. Do not bother about this as it is a normal behavior.

Step 5: Once the form has refreshed select Ctrl + Shift + Q again, this time the utility will display the performance of the form load.


Some notable points:

– This utility is not only restricted to Forms, it will work on Views as well.
– This utility works with both CRM Online and On-Premise versions of CRM 2013 SP1 (and above) and CRM 2015
– The tool seems to be working with both IE and Chrome
– Probably a good idea to Disable the Utility when not in use, only Enable when needed.

Happy new year to all!

CRM 2015: How to create Custom Help for your users

With the new Microsoft Dynamics CRM 2015 version you can customize the “Help” guide for the CRM users.

You can replace the default “Help” of the system at a global level (useful if you have a highly customized system and you want to completely replace Help) or at an entity (record type) level. The implementation is very simple in either case.

To replace the default Help system with a global URL, we have to navigate to Settings >> Administration >> System Settings. Here provide your custom URL for “Global custom Help URL” and save the System settings.


So, now once you click on the below highlighted option, it would re-direct the users to the page mentioned under “Global custom Help URL”, rather than the usual CRM Help page.


You can also Enable custom Help for each Entity by selecting the Use custom Help for customizable entities option in System Settings.

To replace the default Help system at the entity level, you first need to enable custom Help through the System Settings dialog box, and then go to Settings > Customizations > Customize the System and select the entity you want to create custom Help for. Then just select the Use custom Help check box and enter a Help URL. After this Save & Publish your customizations as usual. Now, when a user clicks the Help button for that entity, they’ll get the custom Help page that was specified for the respective entity.



If you want to make your Help system more dynamic, you can append parameters to your URL. For example, you could redirect all Help to a global custom Help URL and display different pages based on the Entity Name parameter. You can also access parameters for Language Code, Entry Point, or Form ID.

Dynamics CRM 2015: Hierarchy Visualizations And Its Limitations

With Dynamics CRM 2015, Microsoft has added a new way to look at records, and their relationships to records of the same entity type.  This new functionality is called Hierarchy Visualizations.  In this post I would like to show you what the hierarchy visualizations look like, but first, let me show you how to set them up.

First off all, you’ll need to go to the Customizations area of CRM, and open up the entity you want to enable hierarchy visualizations for. 

**Note, after installing 2015, some entities are already enabled and setup for hierarchy visualizations, and you won’t be able to change the out of the box setting (accounts, positions, products, and users).  Other entities are setup to allow hierarchy visualizations but not setup by default.  This includes all custom entities.

A new “Hierarchical” field has been added to the 1:N relationship definition. 

**Note that setting this to “Yes” will automatically set the hierarchy flag to “No” for on any other relationship on this entity that was previously setup as hierarchical.  CRM 2015 only allows you to setup 1 hierarchy visualization per entity, and the Parent Entity and Related Entity have to be the same. Limitations to these Hierarchy relationships are also enumerated at the end of this blog.

After configuring your 1:N relationship, you need to navigate to Hierarchy Settings within the entity definition. (For demonstration purpose here, I have selected the OOB Parent Account Relationship on account. As this would be created OOB on upgrading to CRM 2015, hence the Hierarchical Field is set to “Yes” and is disabled.)


Once there, you can create your new Hierarchy Setting.  The Hierarchy Setting is used to define what 1:N relationship to use, and which Quick View Form to use for the tiles that appear in the hierarchy visualization.  You can use one of the out of the box Quick View Forms, or create a new one specifically for the hierarchy visualization. 

There are a few important notes to make about Hierarchy Settings:

  • Only the first 4 fields from the Quick View Form will currently display on the tile. 
  • You can only have have one Hierarchy Setting per entity even though the solution explorer makes it look like you can have multiple.
  • Hierarchy Settings are Solution Aware and will be exported / imported across organizations


Once you have your relationship and your Hierarchy Setting setup correctly, when you navigate to a grid for this entity, if there is a value populated in the field for the relationship you setup for specific records, you’ll see an icon in the grid indicating that record is part of a hierarchy.

For example, in my case I have set up the Hierarchy on the Parent Account relationship. So, whichever accounts have a parent account defined for them, they would appear with the hierarchy symbol on the grid.


Clicking on that icon will open up the Hierarchy Visualization for the record you selected, and show any siblings of that record, the parent of that record, and any children related to that record.


Once you have the Hierarchy Visualization open, there are a few things you’ll notice.  First, there’s a list on the left as well as the larger tiles on the right that are showing the 3 levels of the hierarchy based on what record you selected (current layer, parent, and children)

You can also click on the check mark at the bottom right corner of the tile that will select that record so you can take actions on similarly as if you selected it in a grid (such as assign, edit, share, etc.).

Clicking on the main area of the tile (and not the check mark in the bottom right corner), or selecting a record in the list on the left, will color that tile blue and make it the focal point of the hierarchy and redraw the hierarchy tree.

Finally, on each tile (and also on the list on the left), there’s a “pop-out” icon that when clicked, will open up the form for that particular record in a separate tab/window.  If you’re on the form for a record that’s part of a hierarchy, you’ll be able to quickly display the hierarchy view by clicking an icon in the top right corner of the form.


With these changes above, Microsoft also added a couple new operators to Advanced Find.  Note, these can only be used in Advanced Find queries (don’t show up on sub-grids of specific records)

  • Under:  Finds all records that are UNDER a specific node (For example: all Accounts under “Parent Contoso” Account)
  • Not Under:  Inverse of Under


I would be researching further on the “Advance Features” in my next blogs.

Also an important thing to note is that all of the functionality discussed above will work on the Mobile Client Application as well.  So this powerful new feature will NOT be only available on the web client, making it even more powerful!

With Hierarchy Visualizations, there are still some limitations to be aware of:

  • Maximum of 4 fields are displayed on a tile
  • Visualization is based on a single entity (not multiple hierarchy) – A relationship between 1 entity and itself
  • At most 1 hierarchical relationship allowed for an entity
  • Only 1:N relationships can be enabled to be hierarchical

As the product matures and Hierarchy Visualizations get more real world exposure, I’m sure Microsoft will invest time into resolving the limitations above (e.g., allowing hierarchy  visualizations between different entities, displaying the visualization somewhere other than the entity form like a chart or dashboard, etc.). 

CRM 2013 – Add Pre-Search Filters for Lookup

Often we are faced with a situation wherein we need to filter search results for lookup based on some other value/ conditions which is dynamic in nature.

For example, if we have a lookup on opportunity as “Primary Sales Rep” which should be filtered and should show only those members who are a part of the Sales Team. Then in this case we can add filters to the “Primary Sales Rep” lookup to show only those members who are present as a part of Sales Team.  With CRM 2013, these filters can be added dynamically in the javascript webresource in the OnLoad() event.

Below is the source code which demonstrates adding “PreSearch” filters to lookups in CRM 2013.

function onLoad(){

function preFilterLookup() {   
    Xrm.Page.getControl(“new_lookuptobefiltered“).addPreSearch(function () {
function addLookupFilter() {
    var searchValObj = Xrm.Page.getAttribute(“new_lookupvalue“).getValue();

    if (resident != null) {
            fetchXml = “<filter type=’and’><condition attribute=’new_lookupvalue‘ operator=’eq’ value='” + searchValObj[0].id + “‘ /></filter>”;                    Xrm.Page.getControl(“new_lookuptobefiltered“).addCustomFilter(fetchXml);

In the above code I am filtering a lookup “new_lookuptobefiltered” based on some other lookup values that the user would selected dynamically from the form. We can add as many filter conditions here as we need.

This also helps us to resolve dependent lookups issues and also in cases where in 2011 we had to bind the lookup views dynamically. Happy exploring CRM 2013!