Microsoft Dynamics CRM 2011 Scripting Cookbook
()
About this ebook
Related to Microsoft Dynamics CRM 2011 Scripting Cookbook
Related ebooks
Microsoft Dynamics AX 2012 Development Cookbook Rating: 0 out of 5 stars0 ratingsMicrosoft Dynamics AX 2009 Development Cookbook Rating: 0 out of 5 stars0 ratingsMicrosoft Dynamics CRM 2011: Dashboards Cookbook Rating: 0 out of 5 stars0 ratingsQlikView for Developers Cookbook Rating: 0 out of 5 stars0 ratingsAdvanced UFT 12 for Test Engineers Cookbook Rating: 0 out of 5 stars0 ratingsMDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition Rating: 0 out of 5 stars0 ratingsSitecore Cookbook for Developers Rating: 0 out of 5 stars0 ratingsVisual Studio 2013 Cookbook Rating: 0 out of 5 stars0 ratingsAmazon Web Services Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsMicrosoft Dynamics CRM 2011 Customization & Configuration (MB2-866) Certification Guide Rating: 0 out of 5 stars0 ratingsData Engineering Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsInstant SQL Server Analysis Services 2012 Cube Security Rating: 0 out of 5 stars0 ratingsMicrosoft Dynamics CRM 2016 Customization - Second Edition Rating: 0 out of 5 stars0 ratingsConfidently Unshakeable: Navigating Job Interviews with Poise and Success: Thriving Mindset Series Rating: 0 out of 5 stars0 ratingsMicrosoft Dynamics AX Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsMicrosoft Azure SQL Data Warehouse A Complete Guide Rating: 1 out of 5 stars1/5Expert T-SQL Window Functions in SQL Server 2019: The Hidden Secret to Fast Analytic and Reporting Queries Rating: 0 out of 5 stars0 ratingsInstant Pentaho Data Integration Kitchen Rating: 0 out of 5 stars0 ratingsPro Oracle SQL Development: Best Practices for Writing Advanced Queries Rating: 0 out of 5 stars0 ratingsSalesforce CPQ A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsChange data capture Third Edition Rating: 0 out of 5 stars0 ratingsNosql A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsSQL Server Management Studio Second Edition Rating: 1 out of 5 stars1/5Business Information Systems A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsMicrosoft Dynamics GP 2013 Implementation Rating: 0 out of 5 stars0 ratingsDynamics 365 A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsMy Part-Time Study Notes on Mssql Server Rating: 0 out of 5 stars0 ratingsGetting Started with Oracle Data Integrator 11g: A Hands-On Tutorial Rating: 5 out of 5 stars5/5Microsoft Conversational AI Platform for Developers: End-to-End Chatbot Development from Planning to Deployment Rating: 0 out of 5 stars0 ratings
Information Technology For You
Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5How To Use Chatgpt: Using Chatgpt To Make Money Online Has Never Been This Simple Rating: 0 out of 5 stars0 ratingsChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsCyber Security Consultants Playbook Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5AWS Certified Cloud Practitioner: Study Guide with Practice Questions and Labs Rating: 5 out of 5 stars5/5Linux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Computer Science: A Concise Introduction Rating: 4 out of 5 stars4/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsComputer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/5The Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Rating: 4 out of 5 stars4/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Handbook of Digital Forensics and Investigation Rating: 4 out of 5 stars4/5Google Cloud Platform an Architect's Guide Rating: 5 out of 5 stars5/5Hacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5Cybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5The Programmer's Brain: What every programmer needs to know about cognition Rating: 5 out of 5 stars5/5Inkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratings
Reviews for Microsoft Dynamics CRM 2011 Scripting Cookbook
0 ratings0 reviews
Book preview
Microsoft Dynamics CRM 2011 Scripting Cookbook - Nicolae Tarla
Table of Contents
Microsoft Dynamics CRM 2011 Scripting Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Overview of Dynamics CRM 2011 Customization
Introduction
Opening a free 30-day trial of Dynamics CRM 2011 Online
Getting ready
How to do it…
How it works...
There's more...
Using solutions to package our work
Getting ready
How to do it...
How it works...
There's more...
Solution model
See also
Creating and managing entities
Getting ready
How to do it...
How it works...
See also
Creating and managing fields
Getting ready
How to do it...
How it works...
There's more...
See also
Creating and managing forms
Getting ready
How to do it...
How it works...
Creating and managing scripts
Getting ready
How to do it...
Creating and managing other resources
Getting ready
How to do it...
Creating and managing workflows
Getting ready
How to do it...
How it works...
See also
Creating and managing dialogs
Getting ready
How to do it...
How it works...
Starting a workflow from a dialog
Getting ready
How to do it...
How it works...
Working with security roles and permissions
Getting ready
How to do it...
How it works...
See also
2. Scripting Form Fields
Introduction
Working with text fields
Getting ready
How to do it...
How it works...
There's more...
Retrieving the field name to be used in the script
Formatting phone numbers
Validating Country/Region against State/Province relationship
Writing information back to the text field
Working with number fields
Getting ready
How to do it...
There's more...
Working with currency
Getting ready
How to do it...
How it works...
There's more...
Working with date and time
Getting ready
How to do it...
How it works...
There's more...
Working with option sets
Getting ready
How to do it...
How it works...
There's more...
Assigning a value programmatically
Working with lookups
Getting ready
How to do it...
How it works...
There's more...
Clearing a lookup selection
Changing a lookup selection
Expanding on the State example
3. Field Validation
Introduction
Custom e-mail field validation
Getting ready
How to do it...
How it works...
There's more...
Handling erroneous input
See also
Custom web address field validation
Getting ready
How to do it...
How it works...
There's more...
See also
Validating the ticker symbol field
Getting ready
How to do it...
How it works...
There's more...
Re-routing your request to another provider:
See also
Formatting phone numbers
Getting ready
How to do it...
How it works...
There's more...
Formatting for mobile forms
Formatting postal codes
Getting ready
How to do it...
How it works...
Replacing the Country and Province fields with lookups
Getting ready
How to do it...
How it works...
4. Rules and Events
Introduction
Form load event usage
Getting ready...
How to do it...
How it works...
There's more...
See also
Form save event usage
Getting ready
How to do it...
How it works...
There's more...
Starting a process instead of saving the form
See also
Field change event usage
Getting ready
How to do it...
How it works...
Working with tabs and sections
Getting ready
How to do it...
How it works...
Combining events
Getting ready
How to do it...
How it works...
There's more...
You cannot add new fields dynamically
Be mindful of form layout
See also
Enforcing business rules
Getting ready
How to do it...
How it works...
5. Error Handling
Introduction
Handling unexpected user input
Getting ready
How to do it...
How it works...
There's more...
See also
Handling unexpected processing
Getting ready
How to do it...
How it works...
There's more...
Throwing custom errors
See also
Blocking events
Getting ready
How to do it...
How it works...
There's more...
Forcing a Save
Save and New
Save and Close
See also
Handling UI events
Getting ready
How to do it...
How it works...
There's more...
See also
Advanced error handling
Getting ready
How to do it...
How it works...
Adding a new account and contact with validation
Getting ready
How to do it...
How it works...
6. Debugging
Introduction
Debug messages
Getting ready
How to do it...
How it works...
There's more...
Using IE for tracing and debugging
Getting ready
How to do it...
How it works...
See also
Debugging using Visual Studio
Getting ready
How to do it...
How it works...
Error logging
Getting ready
How to do it...
How it works...
There's more...
See also
Using Fiddler with CRM
Getting ready
How to do it...
How it works...
See also
7. Extended UI Manipulation
Introduction
Showing or hiding form elements
Getting ready
How to do it...
How it works...
See also
Formatting fields
Getting ready
How to do it...
How it works...
Creating a rating gauge field
Getting ready
How to do it...
How it works...
Flagging a section for the user
Getting ready
How to do it...
How it works...
There's more...
Adding a contact picture
Getting ready
How to do it...
How it works...
There's more...
Adding an account logo
Getting ready
How to do it...
How it works...
There's more...
See also
Marking accounts for review
Getting ready
How to do it...
How it works...
See also
Dynamic form elements
Getting ready
How to do it...
How it works...
8. Working with Ribbon Elements
Introduction
Adding a new ribbon button
Getting ready
How to do it...
How it works...
There's more...
Adding a ribbon button to a specific entity
See also
Removing ribbon artefacts
Getting ready
How to do it...
How it works...
See also
Starting a dialog/workflow from a ribbon button
Getting ready
How to do it...
How it works...
See also
Pre-populating form elements with a button click
Getting ready
How to do it...
How it works...
See also
Creating other ribbon artefacts
Getting ready
How to do it...
How it works...
See also
Security trimmed ribbon elements
Getting ready
How to do it...
How it works...
There's more...
Enhancing the progression process of a record
See also
Using the ribbon for displaying information
Getting ready
How to do it...
How it works...
See also
9. Extending CRM Using Community JavaScript Libraries
Introduction
Using jQuery with Dynamics CRM for page element selection
Getting ready
How to do it...
How it works...
See also
Using jQuery and CSS
Getting ready
How to do it...
How it works...
There's more...
See also
Animating form elements with jQuery
Getting ready
How to do it...
How it works...
See also
Using jQuery UI for user interaction
Getting ready
How to do it...
How it works...
See also
Using jQuery UI for customizations
Getting ready
How to do it...
How it works...
Integrating jQuery UI widgets
Getting ready
How to do it...
See also
Using LiveValidation for input validation as you type
Getting ready
How to do it...
How it works...
There's more...
See also
Using Datejs for date manipulation
Getting ready
How to do it...
How it works...
There's more...
See also
10. Light Social Media Integration
Introduction
Integrating with Facebook
Getting ready
How to do it...
How it works...
There's more...
See also
Integrating accounts with LinkedIn
Getting ready
How to do it...
How it works...
There's more...
See also
Integrating contacts with LinkedIn
Getting ready
How to do it...
How it works...
See also
Adding Twitter feeds
Getting ready
How to do it...
How it works...
There's more...
Adding CSS
Parsing URLs
Parsing Tweeter handles
See also
Working with Del.icio.us data
Getting ready
How to do it...
How it works...
There's more...
See also
Index
Microsoft Dynamics CRM 2011 Scripting Cookbook
Microsoft Dynamics CRM 2011 Scripting Cookbook
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2013
Production Reference: 1150313
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84968-882-6
www.packtpub.com
Cover Image by Artie Ng (<artherng@yahoo.com.au>)
Credits
Author
Nicolae Tarla
Reviewers
Michael G. Ferreira
Sandor Schellenberg
Tanguy TOUZARD
Acquisition Editor
Mary Nadar
Lead Technical Editor
Susmita Panda
Technical Editors
Sharvari Baet
Devdutt Kulkarni
Dennis John
Project Coordinator
Esha Thakker
Proofreaders
Sandra Hopper
Samantha Lyon
Lydia May Morris
Indexer
Tejal R. Soni
Graphics
Aparna Bhagat
Production Coordinators
Aparna Bhagat
Prachali Bhiwandkar
Cover Work
Aparna Bhagat
About the Author
Nicolae Tarla is a Senior Consultant in a Solutions Architect role. He has worked on various mid-size to enterprise-level Dynamics CRM and SharePoint solutions for both the private and public sectors. He has been delivering Microsoft Dynamics CRM solutions since the version 3.0 of the product. Nicolae also participated as a technical reviewer on the book Microsoft Dynamics CRM 2011: Dashboards Cookbook.
I would like to thank my wife and daughter, who put up with the hectic schedule and the long nights and weekends consumed over the last few months on this project. They both fully supported me from start to finish. I want to give an additional thank you to Mark for introducing me to the writing process and asking me the dreaded question: When are you writing yours? That was the starting point.
About the Reviewers
Michael G. Ferreira, is a diverse hands on
leader, entrepreneur, and executive consultant with 20 years of widely diverse business and technology leadership experience. He has crafted client/vendor/partner relationships, advisory services, managed large project portfolios, directed product development, implemented transformation change, and pioneered new service delivery techniques.
Since 2003 (Microsoft Dynamics CRM 1.0 beta), Michael has been working with a diverse range of customers and partner organizations (start-up to enterprise; across industries). He has proposed, lead, architected, and deployed over 100+ Microsoft CRM-based technology solutions ranging from out-of-the-box configurations to product upgrades to very complex integrated multi-channel service delivery platforms (CRM, ERP, Portal, Mobile, Social, BI/DW with integration).
Beyond implementation, Michael has played a key role in building the Microsoft CRM partner and consultant community, having helped launch seven organizational practices/delivery teams as well as building and selling his own uniquely positioned Microsoft-based technology solutions provider offering professional and managed services, vertical software/platform-as-a-service products, and hardware and software sales.
I'd like to thank Packt Publishing for letting me participate and my wife for her support throughout the process.
Sandor Schellenberg is the owner and founder of friendlyITsolutions (http://www.friendlyitsolutions.nl/), which mainly focuses on Microsoft Dynamics CRM and related software in the Microsoft stack. He is a Senior Microsoft Dynamics CRM Consultant/Solution Architect and specializes in data migrations and integrations.
In autumn of 2009 his work was recognized and rewarded with an invitation to the Scribe Software MVP Program. In 2013 he was rewarded for a fifth time for the program.
His roots in Microsoft-based Internet technologies go back more than 15 years, and since 2005 he has specialized in Microsoft Dynamics CRM. Starting with his first guest post on the blog of Menno te Koppele, he then decided to start his own blog, Friendly Microsoft CRM Monster (http://www.friendlycrmonster.com/), a blog with a wink. The blog is widely read in the Dynamics CRM community and focused mainly on Microsoft Dynamics CRM technical and integration/migration topics. He is also the author of several musings
at msdynamics.com, where he writes about common topics that have to be faced during implementations of Dynamics CRM.
He has experience with implementing Dynamics CRM in several branches and companies in the small to midsize segment, but also in the enterprise segment. Migrations and integrations are not only within the Microsoft stack, but also with widely used software of other vendors including SalesForce, Oracle, and SAP.
Tanguy TOUZARD is a technical consultant and expert on the Microsoft Dynamics CRM application. Since the first version of the application, Tanguy works on integration projects as a developer, consultant, and trainer.
He has expertise in all areas of development and integration around Microsoft Dynamics CRM (JavaScript, Plugins and workflow activities, Reports) and shares his knowledge through Microsoft forums and his blog. He also developed many tools available to the community Dynamics CRM, which made him a Microsoft MVP in the category Dynamics CRM.
www.PacktPub.com
Support files, eBooks, discount offers, and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Instant Updates on New Packt Books
Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.
Preface
This cookbook presents practical and quick solutions that will teach the reader how to customize Dynamics CRM 2011 with minimal effort. The client-side customizations presented in this book work in conjunction with the system customizations to cover a large scale of customizations available for your environment.
The book moves on to more advanced topics as you progress through the various recipes. While the beginning focuses on the basics of working with client side scripting, the later chapters present various solutions you can implement in your environment to help the user see the collected data in new ways.
Taking advantage of various additional client-side libraries, the customizations presented show new ways to extend your Dynamics CRM environment and achieve new levels of customization otherwise not available.
While some of these customizations do have a counterpart in using plugins, the approach presented here is targeted at system customizers and developers that look to achieve the expected results with the minimal effort and in the shortest period of time. In addition, these customizations will add minimal load to the server side, if any.
What this book covers
Each of the chapters in this book adds incremental information, and is based on the prior knowledge gained from previous chapters. For a user that has already knowledge of customizing Dynamics CRM through scripting, you can skip to the recipes of interest, or follow along and see if there is anything new.
Chapter 1, Overview of Dynamics CRM 2011 Customization, introduces the concept of solution packages, and presents the scripting model used for Dynamics CRM 2011. In addition, basic system configuration and settings that work in conjunction with your customizations are