Friday, December 6, 2013

“Run Report” button on custom entities forms

In CRM2013 the “Run Report” button is missing on custom entities. The button is not available even if you have selected display in the “Forms of the related record types”. The problem is the “Display Rule” named “Mscrm.HideOnCommandBar” associated with the “Run Report” button. It is a default behaviour for custom entities.

There are 2 different ways to display the “Run Report” button on the custom entities.

By adding the "CommandDefinition” to the ribbon definition of the entity.

  1. Create a new solution in CRM, add contact entity to the solution and export the solution.
  2. Open the customization file from the exported solution and look for <RibbonDiffXML> . It will look like the following XML.
  3. <RibbonDiffXml>
      <CustomActions />
      <Templates>
        <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
      </Templates>
      <CommandDefinitions />
      <RuleDefinitions>
        <TabDisplayRules />
        <DisplayRules />
        <EnableRules />
      </RuleDefinitions>
      <LocLabels />
    </RibbonDiffXml>
    
  4. Replace the highlighted line yellow with the following XML
  5. <CommandDefinition Id="Mscrm.ReportMenu.Form">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ReadReport" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
    </CommandDefinitions>
    
  6. Save the file and overwrite the Customization file in your exported solution zip file with this file.
  7. Import the solution zip file and publish it. It’s done.

By using  Ribbon Work Bench 2013


Report button can be easily restored using “Ribbon Work Bench 2013”. Check http://community.dynamics.com/crm/b/develop1/archive/2013/09/06/how-to-restore-a-hidden-button-on-the-crm-2013-command-bar.aspx for the step by step instructions.
Note: Make sure in the step 4 of the instructions,  “Form” is selected in the upper right corner as shown in the following screen shot.

image

Thursday, November 7, 2013

Behaviour of the “Add New” button on sub grids in CRM2013

CRM2013 displays the subgrids slightly differently than CRM2011.  The “Add New” button on subgrids behaves in two different ways.

 

Scenario 1

The following screen shot displays the contact grid on the account form.

image 

The “+” icon represents the “Add New Contact” button. When you click on the button, it pops up the search box as shown in the following screen shot.

image

On click of the image  button, the system displays the following pop up. You need to click on “+ New” button at the bottom right corner to open a new contact form.

image

Scenario 2

The following screen display the opportunities grid on the account entity.

image 

On click of the “+” button. the system displays the new opportunity form.

 

Reason for the behaviour

The difference in the behaviour is  because of “Field Requirement“ property of the lookup field.

In I:N relationship, if the “Field Requirement” property of the look field is “Business Required” then “Add New” button will display a new record form. The following screen shot displays “Field Requirement” of “Business Required” for the “Potential Customer” field in opportunity entity.

image

 

And if the “Field Requirement” property of the look field is not “Business Required” then “Add New” button will display search box as discussed in scenario 1. The following screen shot displays “Field Requirement” of “Optional” for the “Company Name” field in contact entity.

image

Thursday, October 24, 2013

addCustomFilter method for lookup control in CRM2013

In CRM2011, Microsoft introduced a new method “addCustomView” to filter the lookup dialogs.  The process was a bit complicated. You have to create a unique guid, fetchxml, layoutxml and few other things.
In the new release, Dynamics team has introduce a new method addCustomFilter. It makes it very easy to apply filters to the lookup dialog. But there is one gotcha.This method can only be called from a “PreSearch” event handler of the lookup control. This event get triggered as the user is about to view results for the lookup.
We can add and remove the event handler to the PreSearch event using addPreSearch(handler) and removePreSearch(handler) methods.
In this blog, I am going to filter the parent customer lookup on the contact entity based on the city of the contact. Here is the code.

Code

function addEventHandler() {
    // add the event handler for PreSearch Event
    Xrm.Page.getControl("parentcustomerid").addPreSearch(addFilter);

}

function addFilter() {
    //check if the city is not empty
    
    if (Xrm.Page.getAttribute("address1_city").getValue() != null) {
        var city = Xrm.Page.getAttribute("address1_city").getValue();
        //create a filter xml
        var filter ="<filter type='and'>" +
                     "<condition attribute='address1_city' operator='eq' value='" + city + "'/>" +
                     "</filter>";
        //add filter
        Xrm.Page.getControl("parentcustomerid").addCustomFilter(filter);

    }
}

I am calling the addEventHandler function on the form load event.
The addEventHandler() function is used to attach the event handler to the PreSearch event of the “parentcustomerid” lookup of contact entity.
The addFilter() function will be called when the PreSearch event is triggered.

Screen Shot


image
In the screen shot above, the lookup is displaying accounts and  contacts where city is equal to ‘Renton’

Things to remember


addCustomFilter method takes two parameters ‘filter’ and the ‘entityLogicalName’. The entityLogicalName is optional and if this parameter is provided, the filter will only apply to that entity type. Otherwise it will apply to all types of entities returned.

For e.g. customer lookup control display account and contact records. If we don’t provide entityLogicalName  parameter, the filter will apply to both account and contact records and if we provide “account” as a  parameter then filter will only be applied to account records not to contact records.
  

Friday, October 18, 2013

Client side notifications in CRM2013- Part 2

This is second part of my last blog Client side notifications in CRM2013- Part 1. This blog will explain how to display notifications on form level.

Important points regarding form level notifications

  • You can display multiple notifications on form.
  • The height of the notification area is limited so If you have too many notification then user may have to scroll down to see the rest of notifications.
  • The new notification is added at the top of notification area.
The following 2 methods are available to display and clear the notification on form.
  1. setFormNotification  - Xrm.Page.ui.setFormNotification(message, level, uniqueId);
  2. There are 3 parameters for this method
    • message- The text of the notification
    • level- it decides the icon infront of the message. It can be an “ERROR” or a “WARNING” or a “INFO”
    • unique- It can be any unique text string. it has to be unique as we use this uniqueId to clear the notification
  3. clearFormNotification  - Xrm.Page.ui.clearFormNotification(uniqueId);
  4. There is only one parameter for this method
    • uniqueId – it is same that is used to set the form notification

For this blog I have created two functions. 
  • formNotification1 – This function displays an error notification if the value of  “noofemplyees” attribute is less than 5.
  • formNotification2– This function displays an warning notification if the value of  “address1_postalcode” attribute is not 2150.

Code

function formNotification1()
{   
     //check if the value is greater than 5
    if (Xrm.Page.getAttribute("numberofemployees").getValue() <= 5) {

         //set the notification with an error icon
         Xrm.Page.ui.setFormNotification("Employees number should be more than 5", "ERROR", "noofemployees");
    }
    else
   {
       //clear the notification
       Xrm.Page.ui.clearFormNotification("noofemployees");
  }
  }

function formNotification2()
{   
     //check if the postal code is not 2150
    if (Xrm.Page.getAttribute("address1_postalcode").getValue() != "2150") {

         //set the notification with a warning icon
         Xrm.Page.ui.setFormNotification("Account is not located in Parramatta", "WARNING", "postcode");
    }
    else
   {
       //clear the notification
       Xrm.Page.ui.clearFormNotification("postcode");
  }
  }

Result

image

setNotication VS setFormNotification

setNotification setFormNotification
set notification on the control set notification on the form
can create just one notification per control can create multiple notification on the form
only supports error notifications supports error, warning and info notifcations
can’t save the form without clearing the notification can save the form with the notifications

If you are interested in creating a similar functionality in CRM2011, check one of my old blog How to display a warning message on the CRM form. It looks like Microsoft has copied our idea.

Thursday, October 17, 2013

Client side notifications in CRM2013- Part 1

In CRM2011, there was no out of box functionality to show notifications on the entity forms. We have used alert function of JavaScript to pop up the message boxs. There was no way to show the error messages on the form except using web resources. Microsoft has introduced some new JavaScript methods to achieve this functionality in CRM2013.
In CRM2013,notifications can be displayed on form level and/or on field level. This blog will explain How to use notification next to specific control on the entity form.
We can use the following 2 methods to display and clear the notification next to field/control on the form
  1. setNotification- Xrm.Page.getControl(controlname).setNotification(message) :
            This method will display a message near the control to indicate that data is not valid. When this method is used on Microsoft Dynamics CRM for tablets a red "X" icon appears next to the control. Tapping on the icon will display the message.
     2.  clearNotification- Xrm.Page.getControl(controlname).clearNotification() :
            Remove a message already displayed for a control. We have to remove the notification to save the form.
Here is the JavaScript code I wrote to display the notification if the “No of Employees” entered on account form is less than 5.
function fieldNotification() 
{
    //get the control
    cont = Xrm.Page.getControl("numberofemployees");

    //check if the value is greater than 5
    if (cont.getAttribute().getValue()<=5)
    {
        //set the notification
         cont.setNotification("The number of employees should be more than 5");
    }
    else
   {
       //clear the notification
       cont.clearNotification();
   }
    
}

image
The above screen shot displays the notification next to “No of employees” control.

Note

This method is only available for updated entities. Please check the CRM SDK for the list of updated entities.

Monday, July 15, 2013

Asynchronous Patterns in CRM2011- Part 1

Last few weeks, I am trying my hands on creating windows 8 apps for CRM. I was going through a sample solution posted on http://blogs.msdn.com/b/crm/archive/2013/05/28/new-blog.aspx. The most important part of the sample solution is the two projects “WinRt.Microsoft.Crm.Sdk” and “WinRt.Microsoft.Crm.Sdk.Proxy”. These projects are updated versions of  the original SDK dlls to work with windows 8 apps. They have implemented the Event Based Asynchronous Pattern (EAP) to make OrganizationServiceProxy methods to work asynchronously.
I decided to write something about Async patterns and here we go. There are 3 types asynchronous programming patterns.
  • APM – Asynchronous Programming model
It is also known as IAsyncResult pattern. It requires a begin and an end method. For example BeginExecute() and EndExecute() methods. We generally calls the end method in the callback method. You can find the examples of this pattern in the Silverlight samples of CRM 2011 SDK  .
  • EAP – Event based Asynchronous Pattern
The event based asynchronous pattern consist of function/s  Async suffice (MethodNameAsync). These async function/s may have MethodNameCompleted event, which will be raised when the operation is completed. For more info please have a look at the http://msdn.microsoft.com/en-us/library/wewwczdw.aspx.
  • TAP - Task based Asynchronous Pattern
Task based is introduced from .NET 4.0. The Task-based Asynchronous Pattern (TAP) is based on the Task and Task<TResult> types in the System.Threading.Tasks. The biggest difference in TAP, APM and EAP is the initiation and completion of the async operation in a same method.
TAP is the recommend pattern for future development. In this blog we will talk about using TAP for CRM2011 applications that need async calls for example Silverlight and windows store apps.

Why use TAP

As mentioned above in TAP section, the biggest problem the with APM and EAP patterns is initiation and completion of the operation in separate methods.  This force us to put the program logic in different methods.  It makes the code difficult to read.
The good thing about TAP is that it is very easy to write a wrapper for APM and EAP and expose them as TAP implementations. This word document contains a lot of information about TAP.

Consuming the TAP pattern in VS2012

In .Net framework 4.5 TAP pattern can be consumed using a keyword “await”. An await expression must occur inside the body of an asynchronous method, with return type void, Task, or Task<TResult> for some TResult. The await keyword can also be used with .Net frame work 4.0 and Silverlight 5 by using Async Targeting Pack for Visual Studio 2012.
There are also other ways to consume TAP pattern by using methods like “ContinueWith” and “ContinueWhenAll”. For sample code have a look at the Mike Snider’s blog.

Using TAP pattern in Silverlight 5 and CRM2011

In this blog we will talk about how to use TAP pattern with CRM2011 and Silverlight 5. I am going to use  soapforsilverlight sample located at \sdk\samplecode\cs\silverlight\soapforsilverlight of CRM2011 SDK.
If we look at the code we can see the sample is using the following 2 methods to retrieve and display the accounts names. These methods are defined in MainPage.cs file.

        private void AccountList_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                QueryExpression query = new QueryExpression()
                {
                    EntityName = "account",
                    ColumnSet = new ColumnSet()
                    {
                        Columns = new System.Collections.ObjectModel.ObservableCollection<string>(new string[] { "name" }) 

                    },
                    Orders = new System.Collections.ObjectModel.ObservableCollection<OrderExpression>(new OrderExpression[]
                {
                    new OrderExpression() { AttributeName = "name", OrderType = OrderType.Ascending }
                })
                }; 

                query.PageInfo = new PagingInfo { Count = MaxRecordsToReturn, PageNumber = 1, PagingCookie = null }; 

                OrganizationRequest request = new OrganizationRequest() { RequestName = "RetrieveMultiple" };
                request["Query"] = query; 

                IOrganizationService service = SilverlightUtility.GetSoapService(); 

                service.BeginExecute(request, new AsyncCallback(AccountList_ClickCallback), service);
            }
            catch (Exception ex)
            {
                this.ReportError(ex);
            }
        } 

        private void AccountList_ClickCallback(IAsyncResult result)
        {
            try
            {
                OrganizationResponse response = ((IOrganizationService)result.AsyncState).EndExecute(result);
                EntityCollection results = (EntityCollection)response["EntityCollection"]; 

                StringBuilder sb = new StringBuilder();
                if (results.Entities.Count == 0)
                { sb.AppendLine("There are no Account records in the system."); } 

                foreach (Entity entity in results.Entities)
                {
                    sb.AppendLine("Account Name = " + entity.GetAttributeValue<string>("name"));
                }
                if (results.MoreRecords)
                {
                    sb.AppendLine("Only the first " + MaxRecordsToReturn + " records were returned.");
                }
                this.ReportMessage(sb.ToString()); 

            }
            catch (Exception ex)
            {
                this.ReportError(ex);
            }
        } 


There are two methods “BeginExecute” and “EndExecute” which represent the initiation and the completion of the “Execute” operation.  The “EndExecute” is called in the callback method.

Now we are going to write a TAP wrapper for this code. The BeginExcecute method is taking 3 parameters request, callback method and IOrganizationService. We are going to do the same in our wrapper code.

public static Task<OrganizationResponse> Execute(OrganizationRequest request,IOrganizationService service)
        {
            var tcs = new TaskCompletionSource<OrganizationResponse>(); 

            service.BeginExecute(request, (asyncResult) =>
            {
                try
                {
                    tcs.SetResult(((IOrganizationService)asyncResult.AsyncState).EndExecute(asyncResult));
                }
                catch (Exception ex)
                {
                    tcs.SetException(ex);
                }
            }, service); 

            return tcs.Task;
        } 

    } 


TaskCompletionSource is required to get the completed async task. The completion can represents the successful completion of the call, any exceptions and cancellation of the process etc.

TaskCompletionSource exposes 2 methods to set result. We are using tcs.SetResult. You can use TrySetResult. The same applies to set the exception for TaskCompletionSource.

Now we have a TAP wrapper. As I explained earlier, we would like to call this method using await keyword and to do that we need to create an asynchrous method. So here is my asynchronous method.
 
        //async function
        private async void getAccount()
        {
            try
            {
                QueryExpression query = new QueryExpression()
                {
                    EntityName = "account",
                    ColumnSet = new ColumnSet()
                    {
                        Columns = new System.Collections.ObjectModel.ObservableCollection<string>(new string[] { "name" })

                    },
                    Orders = new System.Collections.ObjectModel.ObservableCollection<OrderExpression>(new OrderExpression[]
                {
                    new OrderExpression() { AttributeName = "name", OrderType = OrderType.Ascending }
                })
                };

                query.PageInfo = new PagingInfo { Count = MaxRecordsToReturn, PageNumber = 1, PagingCookie = null };

                OrganizationRequest request = new OrganizationRequest() { RequestName = "RetrieveMultiple" };
                request["Query"] = query;

                IOrganizationService service = SilverlightUtility.GetSoapService();

                //calling the TAP wrapper
                var task = await Execute(service, request);

                // Get the results from the task
                var response = task.Results;

                //Manipulating the result
                EntityCollection results = (EntityCollection)task.Results[0].Value;

                StringBuilder sb = new StringBuilder();
                if (results.Entities.Count == 0)
                { sb.AppendLine("There are no Account records in the system."); }

                foreach (Entity entity in results.Entities)
                {
                    sb.AppendLine("Account Name = " + entity.GetAttributeValue<string>("name"));
                }
                if (results.MoreRecords)
                {
                    sb.AppendLine("Only the first " + MaxRecordsToReturn + " records were returned.");
                }
                this.ReportMessage(sb.ToString());
               
            }
            catch (Exception ex)
            {
                this.ReportError(ex);
            }


        }
I have added the contents of AccountList_Click and AccountList_ClickCallback methods to create this async method. As we can see we can get the result of the call in the same method. Now I will call this method in AccountList_Click.

        private void AccountList_Click(object sender, RoutedEventArgs e)
        {
           // calling the async method   
            getAccount();
        }
You are good to go. Please leave some feedback. In next part we will try to create a TAP wrapper for EAP pattern.

Thursday, May 30, 2013

CRM2011 and GeoFlow

Two weeks ago, I have attended a CRM infrastructure course at CRM enterprise academy. During this course, we were shown a demo of a new Excel 2013 add-in named GeoFlow.  It is a BI tool that can turn the thousands of rows of  data with some spatial information into interactive 3D tour on Bing Maps. It is still in beta and can be downloaded from here.

The example we were shown was using the leads data from CRM2011 with the city and lead source information. It was amazing. I don’t have a lot of CRM data right now but I managed to get some rental bond data for suburbs in NSW Australia. I tried to compare the rental bond data for different suburbs for the month of march in 2007, 2010 and 2013. Here is the screen shot.

image

This is how it looks like in real time.  You can do a whole lot of things with GeoFlow . For example adding multiple scenes, zoom in or out of the map, adding annotations, choosing chart types and selecting an item on the map to get more information etc.

 

 

Have a look at the article from Microsoft Research.

Monday, May 6, 2013

How to use ExecuteMultipleRequest with ServiceContext and Linq

Most of  CRM2011 developers must have used the service context and linq before. I have also blogged about it in the past in one of my plug-in tutorial. CRM rollup 12 has introduced a new method “ExecuteMultipleRequest”. This method receives a collection of requests (same or different type of requests). The method return the response collection. Here is the link to sample code from Microsoft.

I was playing around this method and came across some code from my favourite CRM expert “David Berry”. I tried to use his code with service context and here is the result. I have hard coded few things in my sample but you can change it as required.

The following code is retrieving all the contacts where parent customer id is C6CB814A-BA75-E011-8720-00155DA5304E and updating their phone number.

var ServiceContext = new OrganizationServiceContext(service);
Guid accountid = new Guid("C6CB814A-BA75-E011-8720-00155DA5304E");

// Create an ExecuteMultipleRequest object.
ExecuteMultipleRequest requestWithResults = new ExecuteMultipleRequest()
{
    // Assign settings that define execution behavior: continue on error, don't return responses. 
    Settings = new ExecuteMultipleSettings()
    {
        ContinueOnError = false,
        ReturnResponses = false
    }, 
    // Create an empty organization request collection.
    Requests = new OrganizationRequestCollection()
};
               
requestWithResults.Requests.AddRange(from c in ServiceContext.CreateQuery("contact")
                                    where c["parentcustomerid"].Equals(accountid)
                                    select new UpdateRequest()
                                    {
                                        Target = new Entity("contact")
                                        {
                                            Id = c.Id,
                                            Attributes = { new KeyValuePair<string,object>("telephone1", "+61402234212") }
                                        }
                                    });

// Excute the requests
ExecuteMultipleResponse Response = (ExecuteMultipleResponse)service.Execute(requestWithResults);


If you are using any other entity collection then you can change ServiceContext.CreateQuery("contact") with that.

I have highlighted the following lines
ContinueOnError = false
ReturnResponses = false


These lines are self explanatory. The first line means that continue on error and the second line means that do not return the response. 
Please check the code from Microsoft for complete/detailed explanation.

Tuesday, April 30, 2013

How to disable “Convert the incoming email to contacts” option for the entire organisation

In CRM there an option to convert the incoming emails/appointments into contacts or leads. This option is available only on user level not on the organisation level. The default option is to create contacts.

image

User can enable or disable this option from File->Options—Email tab. But what if you are using queues to receive emails. Queues use email router to send or receive the emails and there is no option to disable “Automatically create records..” option.

I have read somewhere on the CRM forum that if you are using the email router,  “Automatically create records..” setting is derived from the user used in the deployment tab of the email router.

image 

If the “Access Credentials” is chosen “Other specified” then we may be able to achieve the result by changing personal settings of this user.

But if the “Access Credentials” is chosen “Local System Account”  then you don’t have an option as “System” user settings cannot be modified. So there is only one option available and

that is to disable for the whole organisation. This is also a better option if we have to disable auto creation option for every user in the organisation.

How to disable this option for the whole organisation

This can be achieved using  “OrgDBOrgSettings Tool” for CRM2011. Follow this link  to read a kb article on the tool.

  • Once you download the tool and make the changes to the Microsoft.Crm.SE.OrgDBOrgSettingsTool.exe.config as described in the kb article.
  • Run this command  Microsoft.Crm.SE.OrgDbOrgSettingsTool.exe Retrieve [/u] <OrgName>. The result will look like the following screen.

    image
  • Run this command Microsoft.Crm.SE.OrgDbOrgSettingsTool.exe Retrieve [/u] <OrgName>  AutoCreateContactOnPromote False. The result will look like the following screen.
  • image

  • Now run the retrieve command again Microsoft.Crm.SE.OrgDbOrgSettingsTool.exe Retrieve [/u] <OrgName>.
    image 
  • Check the “Current Value” of AutoCreateContactOnPromote. It will be “False”. There you go. It’s done.

 

 

     

Sunday, April 28, 2013

How to display a warning message on the CRM form

We use JavaScript for client side validation on CRM forms. Mostly we use the pop up message box (JavaScript alert function) to display the error/warning messages. The user has to press ok to proceed. If the validation code is running on the formload event then the system will keep poping up the message box everytime the user opens up the record unless the problem is fixed. But if you just want to display a warning message without forcing the user to press ok and fix the problem immediately.

The post is about displaying a warning message without the pop ups.  This solution will display a warning message if the field failed the validation. This does not require any immediate response from the user.

Here is the screen shot of the warning message on account form.
image
For this solution we need 3 web resources
  1. An Image web resource (warning or ! image in front of the message)
  2. A HTML web resource
  3. A JavaScript web resource
You can download the solution containing these web resources from here. Download the solution and publish it.
Here are steps to add the warning message to an account entity form.
  • Open the account entity form in a customise view.
  • Add a new section to the general on the form and move it to the top of the tab. Make sure the name of the tab is “general” and the name of section is “sect_alert_notification” as shown in the screen shot. We are using the tab and the section  name in the JavaScript  web resource.

    image
  • Add the “Notification.HTML” web resource to section. The following screen shots display  the properties of the web resource.

    image
    image
  • Add the “new_Notification.JS” JavaScript web resource to the entity form
  • Call the ShowNotification function on formload event and on onchange event of field you are validating.
    image
  • Update the validation code as required in "ShowNotification” function.
    function ShowNotification() 
    { 
        var Validated= false;
        // Add Validation code Here     
    
    
        if (Validated==false)
         {  
            Xrm.Page.ui.tabs.get("general").sections.get("sect_alert_notification").setVisible(true);
           
        }
       else
       {
          Xrm.Page.ui.tabs.get("general").sections.get("sect_alert_notification").setVisible(false);
       }
    }
    
  • Publish the customisation and test the solution.
Thanks to my colleague Russel Devine for the code. Please leave the feedback as required.

Tuesday, April 9, 2013

Social CRM has finally arrived

Social CRM is finally here, bigger and better than ever before. So what is social CRM? According to Wikipedia
“Social CRM (Customer Relationship Management) is use of social media services, techniques and technology to enable organisations to engage with their customers”
Microsoft is trying to incorporate social into dynamic CRM for some time.

First came the “Activity feeds”. It brought the social sites like features into CRM. Activities feed provides the face book like functionalities. You can follow the accounts, contacts, users and opportunities etc. and write post on the walls like face book. But it is still the communication between internal users.

Then came the “Yammer” integration in roll up 12. It took the conversation out to the external customers. You can communicate with internal users and customers using yammer integration. It is a work in progress and it may kill the activity feed in future.

And now comes the Netbreeze. I am very excited about this collaboration. Microsoft acquired Netbreeze, a social media monitoring and analytics company. I did not go the convergence 2013 but I have an access to “Virtual Convergence”. There are a lot of new features coming out in the next release but Netbreeze integration is my favourite one.

The demo was just amazing. The demo was regarding social feeds for CRM products. Here are some of screen sheets.
image

You can analyse the product you are interested in. For example the following screen shot displays the information about Microsoft CRM.
image

You can drill down further to any of the above information. For example channels or sentiments as shown in the following screen shots.
image

image

You an drill down further to the individual posts. You can even respond to the feeds straight from the system.
image

There are a lot of other things you can do. Anyway I believe it’s a start of an exciting journey.

Please leave feedback.

Saturday, March 30, 2013

CRM2011 roll up 13 and the new SDK is released.

Microsoft released the  roll up 13 for CRM2011. The rollup 13 introduces the support for windows server 2012 and ADFS 2.1. The rollup also resolved the numbers of issues. For the complete list of hot fixes and updates read the following kb article.

http://support.microsoft.com/kb/2791312

Microsoft also released new SDK (version 1.0.15) to support roll up 13. Here is the download link.

http://www.microsoft.com/en-au/download/details.aspx?id=24004

If you have not work with SDK version 1.0.14 then a look at “EntityMetadata” spreadsheet. It lists the metadata about all the out of the box entities ( Entities, entity privileges, attributes, picklist values, relationships and global option sets).

Monday, March 18, 2013

Comparing JavaScript execution time in IE, Chrome and Firefox for CRM Polaris

Last year my team was trying to compare the execution time for REST and Soap (FetchXML and RetrieveMultiple) calls. We did not find any significant difference. Now after rollup 12, CRM supports multiple browsers. I have noticed that chrome seems to load CRM screens quicker than its counter parts.
So, I decided to compare the JavaScript (Rest, FetchXML and RetriveMultiple calls) execution time in Internet Explore, Chrome and Firefox.

Test UI

We have created a custom fields to run these tests. Here is the screen shot of those fields.
image
Here is how the results screen looks like.
image

Test Results

For this test, I set up the frequency to 10 as it may take a bit extra time for the first call. Every call retrieved 10 records. This test is carried out on  CRM Online organisation.

Internet Explorer 10- response time (in milliseconds)

image 

Chrome 25- response time (in milliseconds)

image

Mozilla Firefox 19- response time (in milliseconds)

image

Conclusion

All the execution time are less than sub 500 milliseconds with few exceptions. You can’t tell much difference.
Still REST calls the quickest in Internet Explorer. Overall Chrome is the quickest. You can tell Chrome loads the CRM UI quicker than its counter parts.
Results can vary based on server/client machine’s configuration and work load.
Thanks HP team for the coding.

Friday, March 15, 2013

How to switch between classic and new process flow forms in CRM Polaris

Polaris introduced new UI forms in CRM2011. These new forms come with “Process Flow” and classic form views. They look great but they have some functional limitations.
For example. You can switch from “Process Flow ” to classic view but you can’t switch it back. To get back to “Process Flow Form”, you need to close the form and open the record again. It is very annoying and does not provide a good user experience.
image
Here is the solution to the problem. We need
  1. HTML Web resource
  2. Form Id of the new form
  3. Add a Navigation Link on the form
In this blog I am going to deploy this solution on lead entity.

1. HTML Web resource

I have created a HTML web resource to switch from classic view to “Process Flow Form”. It have added the web resource to a unmanaged solution. You can download it from PolarisSalesForm_1_0.zip. Import the solution into your CRM deployment and publish the solution.

2. Form Id of the new form

We need the form Id of classic view of the form. Here are steps to retrieve the form Id of the lead entity.
  • Open the lead entity in customize mode. Open the form name “Lead” from the list of forms as shown in the following screen shot.
    image
  • Press F11 to get URL of the form. It will look like following screen.
    image
  • Copy the URL into a note pad or any text editor and look for formId. The highlighted part represents the guid of the formid.
    image 

3. Navigation Link on the form

  • Add a new navigation link to the lead form.
  • Add a name and icon file as shown in the screen shot
    image
  • Choose the External URL for the navigation link and refer the URL of HTML webresource we imported in step 1. Use the relative path of the html webresource as shown in the above screen shot.
  • The most important part of the URL is the parameter named data. we will pass formid retrieved in step 2 to this parameter.
  • The URL will look like the following URL.
    /WebResources/new_SalesForm?data=E3B6DDB7-8DF0-4410-AC7B-FD32E5053D38
  • Save the changes and publish the form.

Test The solution

  • Open a entity record.
  • Switch to classic view.
    image
  • The classis form will look like a following screen.
    image
  • Click on the “Sales Form” link on left navigation and it will take you to “Process Flow” form.
I hope this helps.



Sunday, February 17, 2013

Tool tip bug on lookup fields in CRM2011

In CRM2011 only the lookup fields have tool tips.  The tool tip generally displays “Click to select a value for fieldname” as shown in the following screen shot.

image 

The problem starts when you change the the the position of field label from side to top of the field. Before I talk about the bug, lets see “How to change the position of the labels from the side to top of the fields”. This setting is the property of “Section” Control of the entity form. Here are the steps to change the position of the labels.

  1. Double click on the section on the form.
  2. Click on the “Formatting” Tab.
  3. Scroll down and selects “Top” in the “Field Label Position” section as shown in the following screen shots.
    image 
  4. Save the changes and publish the entity. The changed section will look like the following screen shot.
     image

Bug Details

Now coming back to the tool tip behaviour. This behaviour changes based on the position of the lookup field in the section.

  1. If the lookup field is in the first column of the section. For example “Price List” field in the following screen shot. The tool tip will display “Click to select a value” without specifying the field.
    image
  2. If the lookup field is in the second column and there is any other field in the first column. For example “Territory” field in second column and “Price List” field in the first column in the following screen shot. The tool tip will display “Click to select a value for “field name in the first column”.
    image
  3. If the lookup field is in the second column and there is a optionset field in first column. For example “Currency” field in second column and “Payment Terms” field in the first column in the following screen shot. The tool tip will display “Click to select a value for “field name in the first column with all the drop down values”.
    image
  4. Similarly if the lookup field is second column and date time field in the first column then, the tooltip will behave the same way as step 3 displaying all the time slots as shown in the following screen shot.
    image


I don’t have solution to this problem. But you can minimise the impact by adding the lookups in the first column of the section.

Wednesday, January 30, 2013

CCOLA forms in Polaris(CRM2011)

Rollup 12 or Polaris is out for few weeks now. Microsoft have also release the server components for on-premise deployment today.I am playing with Polaris for few weeks now. There are a lot of new features introduced in Polaris and one of them is guided process flow forms or CCOLA forms. CCOLA forms stands for Contact, Case, Opportunity, Lead and Account  entities.These forms are available only in CRM Online at this stage.

These new forms guide the sales and customer service teams through the

  1. Sales Process (More Details)
  2. Case Resolution process (More Details)

The new forms comes with Process flow and classic form views. The following screen shots display the process flow form for lead entity.

image

image

The classic version of these forms are like original CRM forms. Some of the feature are available in both versions of the new forms. For e.g.  Bing map integration and Customer details control( Control displaying few fields customer record on case entity).

Good things about new process flow forms

  1. Guided process flow
  2. Inline editing – No more pop up windows
    image
  3. Bing map integration (for lead contact and account entity forms)
  4. Skype integration
  5. Auto Save
  6. Customer detail pane ( I really like this control. Now we can display the customer’s email and phone number on case entity)
    image

Limitations of new process flow forms

Call the following points the limitations or the scope for the improvements in future releases.

  1. Does not support java script
  2. Left Navigation functionality is limited. You can display the related records but you can’t add a new record. The only way to add new records to switch it to classic view or add the grid on the form.
    image
  3. New button will only allow you to create a new record of same type. For e.g New Button on lead entity will open up a new lead entity form.
  4. There is an option on the process flow form to switch to classic view but there is no option to switch back to process flow view.

Conclusion

This is a good start. I am hoping for a lot of improvements in near future. I would like to see the Bing map integration and customer detail pane as controls, so we can use them where ever we want in the system. Check the following link to learn about all the new features available in rollup 12.

http://rc.crm.dynamics.com/RC/2011/en-us/whatsnew.aspx?ver=5.1#BKMK_NewSales

Please leave the feed back and  add more good things or limitations to the list.