Jun
2
2010
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 pageAs 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...