Book Image

Microsoft Dynamics CRM 2011 Scripting Cookbook

By : NICOLAE TARLA, Nicolae Tarla
Book Image

Microsoft Dynamics CRM 2011 Scripting Cookbook

By: NICOLAE TARLA, Nicolae Tarla

Overview of this book

With the increased adoption of Dynamics CRM 2011, more people are faced with various tasks including administering and customizing the environment. Microsoft Dynamics CRM is a Customer Relationship Management software package from Microsoft. It offers solutions to help companies with Sales, Customer Services, and Marketing. Microsoft Dynamics CRM is increasingly being used by businesses of all kinds and all sizes to reach audiences in new ways. Microsoft Dynamics CRM scripting extends system customization through the use of client-side scripting. It builds on the standard customization options offered by Dynamics CRM."Microsoft Dynamics CRM 2011 Scripting Cookbook" walks the reader through the process of customizing an environment, from the most basic topics such as working with specific fields and types, working with the forms, and then moves on to the more advanced topics of scripting and debugging your scripts, designing new form and ribbon elements, and using additional well known public scripting libraries, as well as integrating external data sources into your environment.The first chapters of this book cover the basics of using the wizard-driven customization approach, packaging your customization into solutions, and adding basic scripts to interact with all the form elements. Further down the road we start introducing concepts around debugging your scripts, working with ribbon elements and navigation, taking advantage of other public scripting libraries and integrating them into your solutions, as well as light ways to bring social information in front of your users.Later chapters will assume knowledge of some of the most basic customizations presented at the beginning of the book. After completing the recipes in "Microsoft Dynamics CRM 2011 Scripting Cookbook", you will have gained a new perspective on how far can you take the customization in Dynamics CRM. The additional details presented around using other public scripting libraries and integrating other data sources into your environment should serve as a start into investigating additional sources.
Table of Contents (17 chapters)
Microsoft Dynamics CRM 2011 Scripting Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Starting a workflow from a dialog


We have looked at workflows and dialogs. But they can function together to achieve a result. For example, we can start from a dialog, capture specific information, and then kick off a workflow as part of the same process to process the information and generate a result.

Getting ready

Using the same solution package, we will be creating two new processes. One is a workflow that sends an e-mail when a field value changes, which we will mark as a child process. The other is a dialog that will call this workflow.

How to do it...

Create the child workflow by performing the following steps:

  1. Create a new workflow, on the Account entity this time. Mark it to run as a child process.

  2. Add a send e-mail step to the workflow, and configure the email properties as described in a previous recipe.

  3. Activate the workflow.

Create the parent dialog that will kick-of this workflow by performing the following steps:

  1. Create the parent dialog on the same entity, as a dialog.

  2. Create a new page, then a question with a Yes/No option set. Create a new check condition step, in which if the value selected in the dialog is Yes, then create a Start Child Workflow step. Look up the child workflow we created earlier and select it.

  3. Save and activate this dialog.

How it works...

The dialog we have created, as simple as it is, prompts the user to decide whether they want to run a workflow or not. When the user selects Yes, the workflow is started.

We can easily test this functionality by going to a new account, and selecting from the ribbon the Start Dialog button. A window prompts us to select the dialog we will run.

We can easily check the execution status of both the dialog and the workflow by navigating on the account to the Processes section.

These two views will give us details about the processes that run against the current account, and the status of each.