Making Opportunity Close Data Available in a CRM 2011 View

Roshan Mehta, 15 February 2012

In my previous post, we saw one issue when closing Opportunities in Dynamics CRM 2011. To recap, sales representatives can enter information about the closure of a deal to see how a particular Opportunity was won or lost. The Opportunity Close activity in CRM 2011 does not provide the ability to make this important information available in a view. Today we will see how we can make this information available on the related Opportunity record using simple customizations and a plug-in.

Firstly, we need to add a few extra fields to the Opportunity record – Close Description and Competitor. The Close Description field is to be added to the “Closed Opportunities”, “Won Opportunities” and “Lost Opportunities” views. We will also add the Competitor field to the “Lost Opportunities” view. Note that these fields do not need to be present on the Opportunity form.

 Making Opportunity Close Data Available in a CRM 2011 View

Next we need to create a simple plug-in which will run on post-create of an Opportunity Close record to copy the data from the Opportunity Close to the related Opportunity record. Here is a code snippet of the method to copy the data:

 Making Opportunity Close Data Available in a CRM 2011 View

I have closed an Opportunity and entered the following information:

 Making Opportunity Close Data Available in a CRM 2011 View

Notice that after we click on OK, our plug-in fires and copies the Competitor and Description to the Opportunity record. We can see this information in our newly created views.

 Making Opportunity Close Data Available in a CRM 2011 View

Using this approach, sales representatives can now see important information about why an Opportunity was close as “Won” or “Lost”.