- 462 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Microsoft Dynamics 365 Extensions Cookbook
About This Book
More than 80 recipes to help you leverage the various extensibility features available for Microsoft Dynamics and solve problems easilyAbout This Book⢠Customize, configure, and extend the vanilla features of Dynamics 365 to deliver bespoke CRM solutions fit for any organization⢠Implement business logic using point-and-click configuration, plugins, and client-side scripts with MS Dynamics 365⢠Built a DevOps pipeline as well as Integrate Dynamics 365 with Azure and other platformsWho This Book Is ForThis book is for developers, administrators, consultants, and power users who want to learn about best practices when extending Dynamics 365 for enterprises. You are expected to have a basic understand of the Dynamics CRM/365 platform.What You Will Learn⢠Customize, configure, and extend Microsoft Dynamics 365⢠Create business process automation⢠Develop client-side extensions to add features to the Dynamics 365 user interface⢠Set up a security model to securely manage data with Dynamics 365⢠Develop and deploy clean code plugins to implement a wide range of custom behaviors⢠Use third-party applications, tools, and patterns to integrate Dynamics 365 with other platforms⢠Integrate with Azure, Java, SSIS, PowerBI, and Octopus Deploy⢠Build an end-to-end DevOps pipeline for Dynamics 365In DetailMicrosoft Dynamics 365 is a powerful tool. It has many unique features that empower organisations to bridge common business challenges and technology pitfalls that would usually hinder the adoption of a CRM solution. This book sets out to enable you to harness the power of Dynamics 365 and cater to your unique circumstances.We start this book with a no-code configuration chapter and explain the schema, fields, and forms modeling techniques. We then move on to server-side and client-side custom code extensions. Next, you will see how best to integrate Dynamics 365 in a DevOps pipeline to package and deploy your extensions to the various SDLC environments. This book also covers modern libraries and integration patterns that can be used with Dynamics 365 (Angular, 3 tiers, and many others). Finally, we end by highlighting some of the powerful extensions available.Throughout we explain a range of design patterns and techniques that can be used to enhance your code quality; the aim is that you will learn to write enterprise-scale quality code.Style and approachThis book takes a recipe-based approach, delivering practical examples and use cases so that you can identify the best possible approach to extend your Dynamics 365 deployment and tackle your specific business problems.
Frequently asked questions
Information
Enhancing Your Code
- Refactoring your plugin using a three-layer pattern
- Replacing your LINQ data access layer with QueryExpressions
- Logging an error from your customization
- Converting your plugin into a custom workflow activity
- Unit testing your plugin business logic
- Unit testing your plugin with an in-memory context
- Integration testing your plugin end-to-end
- Profiling your plugin
- Building a generic read audit plugin
- Using Cross-Origin Resource Sharing with CRM Online
Introduction
- The first sequence at the top traces the layers traversed when unit testing the business logic. As a true unit test, all dependent layers are either skipped or mocked.
- The second sequence in the middle highlights the live integration test, where the plugin is deployed to Dynamics 365 and triggered through the API to mimic a use case. All layers are invoked and the results are verified back in the live Dynamics 365 instance.
- The last sequence at the bottom traverses all the layers; it bypasses Dynamics 365 and uses an in-memory service context as shown here:
Refactoring your plugin using a three-layer pattern
Getting ready
How to do it...
- Create a public interface called IBaseDataAccessLayer in a folder called DataAccessLayer.
- Add the following using statement:
using Microsoft.Xrm.Sdk;
- Add the following two signatures:
void UpdateEntity(Entity entity);
void Commit();
- Create a public base class called BaseDataAccessLayer that implements IBaseDataAccessLayer and IDisposable in the same folder.
- Include the following using statements:
using Microsoft.Xrm.Sdk;
using Packt.Xrm.Entities;
- Remove the organization server and organization proxy from your old plugin and then add a protected variable to your abstract class, as follows:
protected IOrganizationService OrganizationService;
protected OrganisationServiceContext OrganizationContext;
- Create the following constructor for your class:
public BaseDataAccessLayer(IOrganizationService organizationService)
{
OrganizationService = organizationService;
OrganizationContext = new OrganisationServiceContext(organizationService);
}
- Move the methods highlighted here from your original plugin to the newly created parent class, while ensuring that the organization service ...
Table of contents
- Title Page
- Copyright
- Credits
- Foreword
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Preface
- No Code Extensions
- Client-Side Extensions
- SDK Enterprise Capabilities
- Server-Side Extensions
- External Integration
- Enhancing Your Code
- Security
- DevOps
- Dynamics 365 Extensions
- Architectural Views
- Dynamics 365