Archive for category General

Creating Business Rules in CRM 2013

One of new feature added in new release of CRM 2013 is Business Rule. Though this is not very exciting feature provided by CRM 2013 but obviously this is something which developers can relish as it minimizes the burden of common JavaScript validation. Yes that’s true with the use of Business Rules we can easily perform few simple validation in the form without writing a single line of code.

Wow!!!! It sounds great… Let us have a quick walk through of this new feature and see how we can incorporate this for our requirements.


When a lead source is changed to Partner – I want to make

1. Business Phone and Email as Mandatory Fields

2. Hide the Mobile Phone Field

Now let us create a Business Rule to meet the above requirement.  Business Rules comes as a part of your entity in the solution as shown below.


Go to Business Rules for Lead entity and Create a new one. Here we can notice that we can do the following things

1. Add Conditions

2. Add Actions

3. Provide Description

In this example we have added one condition as if the lead source is Partner. In actions we can see that we are making the Business Phone as Mandatory, Hiding the Mobile Phone field and Making the email as Mandatory.


There are very limited options available for the creating the actions like as shown below.


Once we are done with the creation part we need to save this and activate. Similar to Processes we can activate and deactivate this Rules at any point of time. Also if we have multiple forms then we can also define for which forms these rules should be applied.


One good I liked the most is that there is a Save As Option available so we can create multiple rules in minute and then edit accordingly.

Now we can see the desired result in the lead form(UI)LeadUI

Key points to be noted

1. If there is JavaScript written for same field then it executes before your custom business rules(Java script fires before Business Rules).

2.  It does not supports hiding/Showing  Tabs and Sections.

3.  This is similar to JavaScript so these rules do not trigger when any operation is performed by API calls.

4. Well supported in Mobiles and Ipad.

5. Rules can be applied form wise. So in case of multiple forms you may specify for which forms these rules is applicable for.


, , ,

Leave a comment

By default all fields getting updated issue while using oData(REST) endpoint for Web Resources in Silverlight in CRM 2011

Recently I was facing a typical issue, while updating a couple of fields of a form using REST Endpoint in Silverlight, by default all the fields in the form was getting updated to null. I found this as very strange behavior by using REST in Silverlight.

In seek of answer I found that it was the default feature when you use REST Endpoint in Silverlight in CRM 2011.

The Below URL helped me lot which talks in very detailed manner the actual cause and Resolution.

Happy Reading …

, , , , ,

Leave a comment

Programmer’s …..

Just thought of sharing it …….


Leave a comment

Update Rollup 6 for Microsoft CRM 2011

Hey Guys, Microsoft has released Update Rollup 6 for CRM 2011 with many changes and fixes. You must have Microsoft Dynamics CRM 2011 build 5.0.9688.583 installed to apply this update rollup. You can get the latest Update Rollup 6 from

For the list of new improvements and changes you can go through the below KB article

, , ,


Activity Feed in CRM 2011

Activity Feed is a very interesting features introduced in CRM 2011. But it has not become as famous as it should be and one of the most obvious reasons may be that still it has few Question (?) marks that needs to be answered or solved when it comes to security and usability in an efficient manner.

In my opinion still some of the features can be improved as of now in order to accept this globally. But still what we have is lot to cheer about. Why I am dough ting at this time I will clarify later in this post.

Let see how we can use this and take the most out of it.  You can get the Activity Feed solution from the Dynamic Marketplace in CRM Settings tab or you can just do Google. The CRM 2011 server setup that was released before Nov 2011 does not contain this solution. So you have to download and import it manually. But in all the latest CRM versions that are coming after Nov 2011 have this activity feed solution installed from before whether it is Online or On- Premise.

Let’s understand the common terms associated with this. We can say it can act as a Twitter for the CRM users plus lot of many other functions.


Post is an Entity and whatever you write is saved internally as a record. So every item on your wall is a post. It is yet like another entity. You can create new post through Plugin, workflow etc. You can even trigger anything on different operation performed. We will see how to create a post from workflow to meet our business need.


Wall is nothing but the UI html page what we see where all the posts are visible. Records even can have wall and a tab ‘Record Wall’ can be seen for that record.


Follow and Unfollow are the two options that will be visible for all entities but will be enabled for only those entities for which the activity feed will be configured.

Configuration of Activity Feed

After importing the solution you will find three links in what’s New in the Workplace Area and the other two as shown below

Let’s configure some entities. Click Activity Feed Configuration and create records for the entities which we want to configure. Remember give the schema name of entity and not the display name.

The interesting thing I found that we cannot define Rules for the entities. Because we cannot find any add New Rule or Existing button. However the system creates few rules for the few entities that exist from before like Lead, Opportunity, etc.

We can configure for custom entities also but cannot define rule directly which I found the funniest part. I hope that issue gets solved in the coming versions /updates. At present if we want to define some rules for custom entities than we can do that by configuring with a workflow.

For following a multiple records we can do Advance Find select the records to Follow or UnFollow.

Workflow to create a Rule and Post Automatically for Custom Entity

We will see how we can configure activity feed for a custom entity. This can be done through a workflow.  Let’s take a custom entity called “Investor”. So whenever investor is created by any user then we will post stating that an Investor is created. Let it act as a Notification. Let it as simple as this. Anyways we can do a lot and configure the workflow for our custom logic but here we are going through a sample.

        1. Create a Process of category as “Workflow” and configure for ‘When record is created’ as shown below

          2. Now we will configure the properties.

Here we can see the Dynamic value assigned called “Post URL (Dynamic)“. This option is only visible when we have the latest Update Rollup installed. This is basically used to provide a link to that record. So we can open that record by clicking this. This is a new feature update from Microsoft in CRM 2011. Really this is very helpful while creating email form the workflow. We can directly open the record from the Email.

Anyways configuring this workflow save and Activate this workflow.

Result: Now whenever the Investor record is created automatically a post will be created. We can see this post in the What’s new  in the Workplace Area. Here we have created investor record DTest10.

Note: Yet a lot of things are missing and I think that it needs to be improved a bit more so that it can be accepted widely. Few things that are strange or lack in the current version of the solution are in my opinion are:-

1. We cannot create Rules as per our choice for the entities. Eventually we opt for Workflows to configure. 

As we can see that there is no New Button to add any Rules.

2.  The post lacks security. This means that anybody who can view that post can delete that post which will be deleted from the system. This means that the person that created that post is not the sole owner of that post. Even we cannot set anything from the roles and permission point of view.

3. The system creates rules for some of the predefined entities like lead, contact, opportunity etc. We can’t add the rules to the entities configured and yet there is Grid where it can be added.

So these were my concerns in terms of usability. Hope this gets better in the coming versions or update.

 Happy Reading !!!!!!!

, , , , ,


Retrieve Option Set Selected Text Value in CRM 2011

Retrieve Option Set Selected Text Value  in CRM 2011

In CRM 4.0 it was very easy to get the Picklist Selected Text value. But in CRM 2011 the Picklist has been changed to Option Set and interestingly they have not exposed any Property to get Text value of the selected value.

So now we can get the value only from the Metadata. It’s not huge but simple to implement. Below is the method which returns the Selected Text Value on Passing the Integer Value.

public string GetPickListText(string entityName, string attributeName,int optionSetValue,IOrganizationService service)
    string AttributeName = attributeName;
    string EntityLogicalName = entityName;
RetrieveEntityRequest retrieveDetails = new RetrieveEntityRequest
    EntityFilters = EntityFilters.All,
    LogicalName = EntityLogicalName
 RetrieveEntityResponse retrieveEntityResponseObj = (RetrieveEntityResponse)service.Execute(retrieveDetails);
 Microsoft.Xrm.Sdk.Metadata.EntityMetadata metadata = retrieveEntityResponseObj.EntityMetadata;
 Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata picklistMetadata = metadata.Attributes.FirstOrDefault(attribute => String.Equals(attribute.LogicalName, attributeName, StringComparison.OrdinalIgnoreCase)) as Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata;
 Microsoft.Xrm.Sdk.Metadata.OptionSetMetadata options = picklistMetadata.OptionSet;
IList<OptionMetadata> picklistOption = (from o in options.Options
 where o.Value.Value == optionSetValue
 select o).ToList();
string picklistLabel = (picklistOption.First()).Label.UserLocalizedLabel.Label;
 return picklistLabel;

Now by using this we can easily get the selected option set value of any attribute of any record. Now to retrieve the text value we need to pass the value of the option set.

For e.g [How to call] To Get the selected text for Shipping method for a contact record

IOrganizationService service = GetCrmService();//Get the Crm Service 
string textValue=GetPickListText("contact","address1_shippingmethodcode",5,service) ;

I hope this really helps. HAPPY Reading !!!!!


, ,


CRM 2011 Top 10 New Features

There are lot of new features that have been Introduced in CRM 2011. Some of the New Features are :

1. DashBoard

2. Charts

3. Goal Management

4. Connections

5. Auditing

6. Multiple Forms based on Roles.

7.Option  Sets – Global Picklist

8. Solution Packaging

9. Web Resources

10. Processes – Work Flows and Dialogs

Leave a comment