Chapter 6. Programming Workflow

Microsoft Dynamics CRM includes a workflow module that allows you to create a set of rules that the software will run automatically based on trigger actions that you configure in the system. Some of the potential workflow rule triggers include creating a new record, updating a record status, assigning a record, and modifying a data field. Using workflow allows you to create automation processes, including:

  • Assigning leads based on geography

  • Creating e-mail alerts if a particular data field changes

  • Updating record values or creating new records

  • Implementing a sales process

Because every organization has unique business automation needs, Microsoft designed the workflow module to accommodate a wide range of functionality. And because business needs change frequently over time, Microsoft Dynamics CRM designed the workflow module so that power users (nondevelopers) can create, modify, and publish workflow rules through a Web-based workflow designer.

While the Web-based workflow designer offers great functionality and flexibility to create complex business processes, you will undoubtedly encounter requirements that you simply can’t accommodate within the workflow designer. Fortunately, Microsoft Dynamics CRM allows you to create custom programming code that you can reference in a workflow rule as a workflow assembly. Similar to plug-ins, workflow assemblies support .NET-compliant languages so that you have the option to create your workflow assemblies with your preferred tools. Once you create and register a workflow assembly, your power users can reference and utilize these assemblies within the workflow designer. Therefore, they don’t need to understand the details of the workflow assembly code, but they can take advantage of the assemblies you created.

In this chapter, we will briefly recap how to create, publish, run, and test a workflow rule in the workflow designer, and then we’ll explore how Microsoft Dynamics CRM workflow utilizes Windows Workflow Foundation. Then we’ll go deep into the specifics of creating a workflow assembly and registering it with Microsoft Dynamics CRM. We’ll wrap up the chapter with several real-world sample workflow assemblies.

Chapter 12, takes an even deeper look at workflow programming by exploring using workflow as entities and creating declarative workflows with XAML.

More Information

More Information

For a comprehensive review of workflow basics and how to use the workflow designer, please refer to Working with Microsoft Dynamics CRM 4.0 by Mike Snyder and Jim Steger (Microsoft Press, 2008). This book goes into more detail about creating workflow rules with the workflow designer, setting security on workflow, and troubleshooting.

Overview

In this chapter we cover the following topics:

  • The workflow designer

  • Windows Workflow Foundation

  • Custom workflow activities

We conclude this chapter with three workflow programming examples: math building blocks, retrieve most available user, and calculate related aggregate.

Important

Important

At the time this book went to press, you could not deploy your workflow assemblies to Microsoft Dynamics CRM Online deployments. Therefore, this chapter only applies to on-premise or partner-hosted deployments.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset