Aug 16, 2016

Dynamics CRM Data Migration ModifiedOn


It was always a pain during data migration to get your modifiedon, modifiedby from existing data to CRM. Good News is some of our blogger comes up with solution. It was working for me for CRM 2016 online.

I was able to update modifiedon dates for my activities. Here is the approach and solution –

I have created dummymodifiedon field and got the actual modifiedon datetime values in that field during migration. I have used that to set my modifiedon date.

Here is the exact code I have used in my preplugin. That’s it you are good.

    public class MigrationPrePlugin : IPlugin
        public void Execute(IServiceProvider serviceProvider)
            var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));

            var service = factory.CreateOrganizationService(context.UserId);

            // The InputParameters collection contains all the data passed in the message request.
            if (context.InputParameters.Contains("Target") &&
            context.InputParameters["Target"] is Entity)
                // Obtain the target entity from the input parameters.
                Entity entity = (Entity)context.InputParameters["Target"];
                entity["modifiedon"] = entity["new_dummymodifiedon"];

Here is the original blog post –

Happy Coding

May 16, 2016

Quote Activate Plugin Message


It took a while for me to figure out what is the plugin message to activate the quote. 
We need register it on 
  • SetStateDynamicEntity of Quote to fire the plugin. 
Keep in mind, revising activated quote doesn't trigger above message but you need to register messages on quoteclose entity. 

Activate Statecode is "1" when activated. 

Its kinda tricky.

Happy Coding,

Jan 27, 2015

Microsoft Dynamics CRM Report Authoring Extension Setup - Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed. Fatal error during installation

I was trying to install Microsoft Dynamics CRM Report authoring tool 2013 - CRM2013-Bids-ENU-i386 and getting below error


Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed.

Fatal error during installation.


I was using visual studio 2012 and BIDS 2012. If you read installation instructions, it says.

You'll need to use either VS2010 w/ SQL Server Data Tools or BIDS 2008 w/ SP1

VS2012 is not yet supported :(

Check this out . http://www.microsoft.com/en-us/download/details.aspx?id=40343

Check this blog if you still see same error http://community.dynamics.com/crm/f/117/t/138394.aspx

Hope it saves some of your time.

Jan 5, 2015

CRM 2013 Iframe Displays blank content

Recently, I was working on displaying an Iframe on the opportunity entity form. It is pretty straight forward task however it took me a while to understand what is going on.

Basics – In order to add an Iframe to page, you can just add an iframe to crm form and set the source of iframe static url or dynamics. Just refer documentation in sdk about dynamically setting source of an iframe

I am using CRM online and an iframe for displaying SSRS report hosted locally.

The Problem – CRM online uses https(secure protocol) for communication and local SSRS report was using HTTP. It is unsecured to display https & http under the same page and modern day browser doesn’t show it to user so we get blank content in an iframe.

How can we resolve the issue-

1. You need to make your page available over https, in my case SSRS report should be over https

2. If you can’t make your page available over https then you need live with following .

Internet Explorer -

  • IE would display warning message “Show all content” and you need to click it to display an iframe content


  • You can do following setting to avoid it in IE -
    • Add crm online and other website to trusted sites


    • Set IE to display mixed content


    • you shouldn’t see the “Show all content” popup in IE now

  • Enabling mixed content in Google Chrome
    • Chrome would display security warning at top, please click and load unsafe script



I hope this shouldn’t eat your time :)

Happy Programming-


Apr 3, 2014

CRM 2013 Save Event Arguments

Using save event arguments, you can manipulate save event processing -

from Sdk -

In the save event you can use the execution context object getEventArgs method to retrieve an object that contains methods you can use to manage the save event.

Save Event Argument Methods

Returns a value indicating how the save event was initiated by the user.
Returns a value indicating whether the save event has been canceled because the preventDefault method was used in this event hander or a previous event handler.
Cancels the save operation, but all remaining handlers for the event will still be executed.



Mar 12, 2014

Say no to blurry label

With CRM 2013, we started seeing fields with blurry label and changing of just label width doesn’t help. In order to display complete label, we also need adjust the label area’s pixel in the section of a field. This is how you can do it.