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 fields


Once we have an entity ready to work with, whether it's a new custom entity or an existing out-of-the-box entity, we can start managing the information to be captured.

Getting ready

In this recipe, we will be building on the custom Country entity we created in the previous recipe. Open the created solution and navigate to the created Country entity. We will be adding two more fields to capture the country code and display sequence.

How to do it...

In order to add the additional fields to capture information, we will follow these steps:

  1. Expand the Entities section in the solution, and expand the Country custom entity that we created:

  2. Select the Forms option, and look at the view of forms associated with this entity.

  3. By default, we will be presented with two views, one that we will customize, and another mobile form. We will open the first form, of type Main.

  4. From the bottom-right of the screen, we will click on the New Field button.

  5. We will create a field with the display name of Country Code, no requirements constraint, and of type text, single line, with a maximum length of 3. We will be using this field to capture country codes such as CA, USA, and UK.

  6. Once complete, we'll click on Save and Close. The new field will show in the listing of All Fields in Field Explorer.

  7. Now we can simply drag this field on the form, under our Country field.

  8. With this field already added to the form, we can add a new field called Display Sequence, of type Whole Number, as described by the following screenshot:

  9. We will be adding this field to the same form. This entity will be used in the next recipe. The end result should look like the following image:

  10. Now we can click Save on the form screen, and then Publish. All customizations must be published before they are visible to all users.

  11. Once all customizations are published, we can verify the form by navigating to the Settings area, and looking under Extensions. We will find our custom Countries entity there.

  12. Clicking on Countries will show us a view of all Active Countries (default view). We can click on New to see how the customized form will look.

  13. If we are not satisfied with the way the form looks, we can go back to the solution and tweak the look of it again, or else we can proceed further.

How it works...

Because we have configured the new entity to be visible only in the Settings section, we will have to navigate to Settings to get access to the listing of countries we will be adding to the system. We have customized it as such so that when we build a more complex solution later in the book, we can make sure that only authorized users will be able to see and modify the listing of all countries in such a way.

There's more...

Dynamics CRM 2011 allows us to define a large number of field types. We have only covered two simple examples here, one of text and one of whole numbers. Additional field types will be described in the following recipes, when we start looking at how to script these fields.

See also