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

Creating and managing scripts


JavaScript scripts are added to a solution package just like any other resource. They are becoming part of the package, and thus are easily portable to other environments, along with the solution.

Getting ready

Using the existing solution package we have created, we will be adding a new JavaScript resource.

How to do it...

To add a new JavaScript resource, navigate to Settings, and open your existing solution package. Follow these steps to add a script resource:

  1. In the package, navigate to Web Resources.

  2. In the Web Resources view, select New to add a new script resource.

  3. Give the resource a name, and select the Script (Jscript) option from the Type drop-down list. The Display Name should be in a readable format. It is good practice to always add a Description for other developers that will follow in your foot steps to easily identify the content of the library without having to open the file.

  4. Click on Save, and then on Publish. Now you have a JavaScript resource added to your solution package. There is no actual script added yet, so let's do that.

  5. Click on the Text Editor button. A new form will open allowing you to type in your script.

  6. Click OK, then Save and Publish your resource again.

  7. Now we have a script added as part of the solution package. It is not related to any action, but we will cover that in one of the later recipes.

Sometimes a script resource can become obsolete, and we would want to remove it. In order to remove a script resource that is not associated with any other system entities, perform the following steps:

  1. From the Web Resources view, select the script.

  2. Click on Delete.

  3. Make sure to click on Publish all Customizations for the changes to take effect. Now your script resource has been removed.