How to implement Convert Lead feature in CRM 4.0


I’ve been dwelling in the world of MS CRM 4.0 for more than a month now, it’s a pretty¬†decent product. In terms of development on CRM, it’s not exactly a pleasant experience. Because it’s such a closed and inflexible ecosystem, there’s only ever 1-2 ways to do something. After doing stuff for a while, it gets pretty repetitive and monotonous. However there was one piece of work that I had to complete which proved to be a little tricky, and I’m going to share with you in this post.

Essentially, I had to implement a behavior that is close to the “Convert Lead” feature in CRM. It was not as straightforward as I though it would be, and here’s the breakdown of things you need to do in order to implement the entire feature.

  1. Create a custom aspx / html page (ideally done entirely using JScript, because any postback on the dialog web page causes issues)
  2. Write JScripts on custom page to convert, deactivate the current record and validation.
  3. Modify ISV Config file to add a button into the toolbar.
  4. Add an Onload JScript to hide the button when entity is inactive. (there’s not in-built way in the ISV Config to do this, which really sucks)

Let’s use a fictitious entity for this example, called new_entity. So here goes.

Read the rest of this entry »

AJAX enabled WCF Service and ASP.NET


A friend of mine has recently asked me some questions about ASP.NET AJAX and I decided that it would be a good idea to explore this, and publish it as a blog post. I whipped up a simple application that uses ASP.NET Ajax web form and it consumes services from a AJAX-enabled WCF Service. It’s fairly straightforward, so I’m going to dive straight into the implementation details, and some problems I encountered. I’ve made use of the data grid control from an open source library called Ajax Data Controls for this sample because it’s been designed for client side scripting and is more intuitive to use compared to the ASP.NET ones. Of course this could have been easily done with JQuery, but I wanted to try something different.

wcf_ajax Read the rest of this entry »

JQuery Charts


I recently came across an very nice plugin for JQuery to create graphs and charts. Like many other JQuery plugins, it’s very easy to learn and takes no time at all to get up and running. This plugin is call jqPlot. If you need charting capabilities, jqPlot is definitely worth taking a look at. jqPlot has internally a plugin system as well, which allows you to specify different kinds of ‘renderers’ to create different kinds of charts. This framework is really cool, as it provides many useful renderers out of the box like bar charts, pie charts, and line charts. I’ve done up a very simple webpage with some data on blogging statistics, and you can spin up different kinds of charts using the buttons.

Read the rest of this entry »

JQuery UI and Validation


I’m still on my journey to become more proficient in JQuery, and the best way to get better is to do more hands-on. This time, I worked on an example for a simple registration form, with some animations, and made use of JQuery UI library and JQuery Validation library.

The sample registration requires you to first fill in “Step 1” of the registration process before you can go to “Step 2”. Each step is lazily validated until you click the “Next” button, and the fields will be eagerly validated after that. Below are screenshots of validation provided by JQuery Validation library.

JQueryRegister_ValErrorJQueryRegister_ValValid

Read the rest of this entry »

JQuery: Animated Film Strip


I have seen a number of implementations of animated film strip on websites and I’ve always wondered how it’s been done. Using Silverlight, I feel it’s pretty straightforward with the built-in animation API, but with normal HTML it becomes a non-trivial task, especially if everything is to be client side scripted. With my limited knowledge of JQuery, I decided to give that a go using ASP.NET 2.0.

Read the rest of this entry »

JQuery: Animated Collapsible List


The more you use JQuery, the more intuitive it becomes, as well as easier and enjoyable. I extracted this example from a book I’m reading, and I will provide links at the end of this post to aid understanding. Here’s a snapshot of the demo, and when you click on the + or -, it will collapse or expand the children with animation.

collapsablelist2

Download this demo’s zip file here. (just unzip and open the html in your preferred browser.)

Read the rest of this entry »

Introduction to JQuery


I’m on my vacation in Taiwan right now, it’s been very relaxing and I’m enjoying some of the most beautiful scenery I’ve ever seen. As usual, I always try to bring some reading material on my vacations to maximize spare time like traveling between areas, plane, or just idle time. This time round, I’ve¬† decided to explore the world of JQuery, a lightweight client side scripting library. I’ve heard very good things about JQuery and became especially excited when I learnt that Microsoft will be shipping JQuery in future versions of Visual Studio. As a consultant that works primarily with Microsoft technology, it’s a joy to see that MS is adopting Open Source, and I feel that JQuery will be able to fill the missing gap in MS’s lack of tools/API for client side scripting.
Read the rest of this entry »