Jun
2
2010

A macros system for Dynamics CRM - part three

In part one of this series, I explained the basic idea behind a macros system for Dynamics CRM and a situation in which you'd want to use it instead of a workflow for process automation. I explained the structure of the macros system and showed the CRM entity form customizations that are required to implement it in part two. In this final part I'll show the ASP.Net code that does the heavy lifting for our basic policy renewal example.

The macros page
As I mentioned earlier, we use an ASP.Net Web Forms application to run the macros system, so we need to create a .aspx page for the policy macros. Because we believe in separation of business logic and presentation, our .aspx page requires two separate files, the .aspx page itself and its code-behind.

Our .aspx page has two sections. First, there is the list of links that trigger the various macros. It looks something like this:
<asp:LinkButton ID="renewLinkButton" CssClass="text" runat="server" OnCommand="RenewPolicy" CommandArgument="Renew">
Renew policy
</asp:LinkButton>
<br />
<asp:LinkButton ID="anotherLinkButton" CssClass="text" runat="server" OnCommand="SomethingElse" CommandArgument="Renew">
Another macro
</asp:LinkButton>
More...
May
24
2010

A macros system for Dynamics CRM - part two

In part one of this series, I explained the basic idea of what a macros system for Dynamics CRM is and a situation in which you'd want to use it instead of a workflow for process automation. In this post I'll explain the structure of the macros system and show the CRM entity form customizations that will be required to implement it.

As I mentioned in part one, the idea underlying the macros system is that a user can trigger several distinct steps by clicking a single hyperlink. We achieve this by showing the user, via an iframe on the entity form, a page of hyperlinks specific to a given entity type. The macros page will also need to know the specific entity its actions will target. This requires the following:

  1. An iframe on the entity form in CRM.
  2. JavaScript code to load the macros page in CRM. (This isn't strictly required, but you'll get ugly errors in the create entity form if you specify the iframe URL directly.)
  3. A separate Web page per entity that will offer macros to do the work.
In this post I'll outline the first two steps, and I'll show sample code for the macros page in part three.
May
20
2010

A macros system for Dynamics CRM - part one

Workflows in Dynamics CRM can do a lot, but a significant limitation is that they're asynchronous. If you need to automate server-side code execution and interact with the user at the same time, you're out of luck. This is where you can use something that I call a macros system.

This is the first of a three-post series in which I will:
  • outline a business problem that a macros system can solve
  • give an overview of the structure of our CRM macros system 
  • share some sample code for how to implement a basic set of macros for a CRM business entity.

More...

About the author

I work with information systems, mainly Microsoft Dynamics CRM, C# development and SQL Server. Technology is OK, but using it to run a business better is even more interesting.

Month List