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 forms


In certain instances, we will require additional forms for the same entity. One obvious example is when we need to implement role-based forms. In such instances, a specific role could have access to only a subset of fields, while a different role could have access to other fields. We could have an overlap of fields available to all roles too.

Getting ready

Open the previously created solution, and navigate to the Countries entity we created. In the view of All Forms, by default, we only have the two forms, one for the normal use and one for mobile.

How to do it...

Adding a new form can be achieved as follows:

  1. From the All Forms view, select New | Main Form, or simply click on New.

  2. On this new form, we can remove the Country Code and Display Sequence fields, by selecting each field and clicking on Remove on the ribbon.

  3. Click on the Form Properties button on the ribbon, and on the Display tab (second from the left) to define a new name for our form.

  4. Once the fields are removed and the form renamed, we can save and publish the new form.

  5. With the form published, we can verify the listing of All Forms to make sure the form is saved.

  6. To verify how this form is presented to users, we can navigate to Country created in the system, and select from the available forms.

  7. Now, both forms are available to be selected for users that have permissions to view both. We will be covering role-based forms later in a different recipe.

Removing a form is also a relatively simple process.

  1. Navigate in the solution package to the All Forms view and select the form to be removed.

  2. Click on the Delete button.

  3. Publish all customizations.

How it works...

Creating various forms for entities can help reduce the amount of scripting required to hide/show fields. We can assign specific forms to specific user roles, and thus reduce the amount of client-side processing on the form.