Archive for the ‘General’ Category

Customizing Charts using XML – Part 1

Dynamics CRM 2011 provides a very useful feature called charts. Charts can be designed within charts designer provided out of box and they can also be customized using charts XML. In this post we will look into various customization options available to design charts using XML.

Charts are used to display and portrait information in a meaningful way so that chart’s audience can quickly understand and analyse data trends. Some charts convey message more accurately than other. For example, a line chart conveys trending information better than a pie chart.

There are a handful of chart types available in charts designer such as:

  1. Column chart
  2. Bar chart
  3. Line chart
  4. Pie chart
  5. Funnel chart
  6. Multi-series chart
  7. Stacked charts
  8. Mixed chart
  9. Series chart

Dynamics CRM 2011 uses Microsoft Chart Controls for Microsoft .NET Framework 3.5. This framework is rich in functionality and provides more chart types. Following chart types can be consumed within Dynamics CRM 2011.

Area StackedArea Column StackedColumn100
Pyramid Funnel Renko PointAndFigure
Bar StackedArea100 Doughnut StepLine
Radar Kagi Spline Polar
BoxPlot StackedBar ErrorBar Stock
Range Line SplineArea ThreeLineBreak
Bubble StackedBar100 FastLine
RangeBar Pie SplineRange
Candlestick StackedColumn FastPoint
RangeColumn Point

Let’s dig deep into Chart XML and Customize few of them to unleash their potential.


JavaScript Libraries in Microsoft Dynamics CRM 2011

In Microsoft Dynamics CRM 4, it is a very tedious task for system customizers to manage and track JavaScript. System Customizers/Developers have to write JavaScript on every event handler on the form. But Microsoft Dynamics CRM 2011 provides JavaScript libraries that can be utilized on events and forms across the solution. Now common JavaScript functions can be written at one centralized JavaScript file and utilized across solution.

Moreover, multiple JavaScript libraries can be created. For example, one common library for general CRM Service calls and one common library for UI manipulation and so on.

Let’s create a very simple JavaScript library and create a function to hide/show a tab/section on the form. JavaScript libraries are added as web resources in solution as shown below:

Now let’s create a JavaScript Common Library by adding a web resource in the solution. Then attach a JavaScript file this web resource.

Now let’s open the file in Text Editor available in web resource to add a function to show/hide a section/tab on form.

Microsoft Dynamics CRM 2011 provides new xrmPage model to access UI and data at client side. Here is a snapshot of the hierarchy.

Now let’s go to the account form in solution and then go to form properties to set JavaScript library and function to execute on form load event handler as shown below:

Now let’s add library from solution library.

Now let’s call the HideShowSection function in JavaScript Library by selecting appropriate JS library and typing the right function.  Enable the event handler by setting Enable flag to true. Also pass parameter to function by comma separated list of parameters i.e. 1, false which in turn sets tab 1 to visible false.

You can see that Details tab is now hidden and alert.