Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Extending Microsoft Dynamics 365 for Operations Cookbook
Extending Microsoft Dynamics 365 for Operations Cookbook
Extending Microsoft Dynamics 365 for Operations Cookbook
Ebook733 pages3 hours

Extending Microsoft Dynamics 365 for Operations Cookbook

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

About This Book
  • Follow practical and easy-to-grasp examples, illustrations and coding to make the most out of Dynamics 365 for Operations in your business scenario
  • Extend Dynamics 365 for Operations in a cost-effective manner by using tools you already have
  • Solve common business problems with the valuable features of Dynamics 365 for Operations
Who This Book Is For

This book is for those who are getting to grips with Dynamics 365 for Operations developers or those migrating from C# development. The guide includes information essential for new and experienced Dynamics 365 for Operations developers.

LanguageEnglish
Release dateMay 18, 2017
ISBN9781786463302
Extending Microsoft Dynamics 365 for Operations Cookbook
Author

Simon Buxton

Simon Buxton, author of The Shamanic Way of the Bee, is the founder/director of The Sacred Trust in England, dedicated to the teaching of practical shamanism for the modern world. He is also the co-author of Darkness Visible. He teaches Darkness Visible workshops internationally and lives in England.

Read more from Simon Buxton

Related to Extending Microsoft Dynamics 365 for Operations Cookbook

Related ebooks

Enterprise Applications For You

View More

Related articles

Reviews for Extending Microsoft Dynamics 365 for Operations Cookbook

Rating: 5 out of 5 stars
5/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Extending Microsoft Dynamics 365 for Operations Cookbook - Simon Buxton

    Title Page

    Extending Microsoft Dynamics 365 for Operations Cookbook

    Extend the potential of your Dynamics 365 for Operations implementation

    Simon Buxton

        BIRMINGHAM - MUMBAI

    Copyright

    Credits

    About the Author

    Simon Buxton has worked with Dynamics 365 for Operations since its earliest incarnations, starting out as a consultant and developer in early 1999 when Dynamics 365 for Operations was known as Damgaard Axapta 1.5. He quickly became a team leader at Columbus IT Partners and carried out one of the first Axapta implementations in the UK before joining a new reseller, Sense Enterprise Solutions, as its technical director. Sense Enterprise Solutions enjoyed a global reach through the AxPact alliance, where Simon was placed as AxPact's Technical Lead.

    Simon played a major role in growing the company into a successful Microsoft partner and was the Technical Lead on a number of highly challenging technical projects around the world, ranging from the UK, to Bahrain, to the USA. These projects include developing solutions for third-party logistics, multichannel retail, and eventually developing an animal feed vertical, as well as integrating Dynamics 365 for Operations into production control systems, government gateways, and e-commerce solutions, among others.

    Now, working with Binary Consultants, he was part of a team that implemented the first Dynamics 365 for Operations implementation with support from Microsoft as part of the Community Technical Preview program (CTP). The knowledge gained as part of this process led to the creation of this book.

    Simon has also worked on Mastering Microsoft Dynamics AX 2012 R3 Programming and Microsoft Dynamics AX 2012 R2 Administration Cookbook.

    I would like to thank my colleagues at Binary Consultants for their continued support throughout the writing process. I would also like to thank all those who helped review this book, Martin Winkler and Simon Klingler in particular, who put in a lot of effort into reviewing each recipe. A lot of the insight written into this book was only possible by being part of the Dynamics 365 for Operations community technical preview process, and working with Microsoft's R&D team is a true privilege.

    Finally, I am told, I have to thank my partner, Evi, for her patience and support as I disappeared for hours each night and weekend working on yet another book?. Of course, no bio could be complete without mentioning my children, Tyler and Isabella, who seem bemused as to why I would voluntarily do homework.

    About the Reviewers

    Simon Klingler has been working with Microsoft Dynamics 365 for Operations and its predecessor products (Microsoft Dynamics AX, Axapta) since 2001. He gained experience as a developer, consultant, presales consultant, product manager, and solution architect. He has successfully implemented ERP solutions in national and international projects from 3 to 1000+ users. He was a product manager for several add-ons for Microsoft Dynamics ERP solutions.

    He started working on the latest release in its very early days and regularly exchanged experiences, feedbacks, and lessons learned with the author of this book.

    Currently, he is working on several cloud and local business data implementation projects as a solution architect.

    In 2013, Simon co-founded Semantax, a company providing products and expert consulting services based on Microsoft Dynamics AX. In December 2014, he co-founded the Solutions Factory (www.sf-ax.com), a company delivering full-scale Microsoft Dynamics ERP implementations, in stable and long-lasting partnerships with its customers.

    He is especially proud of the team that was formed in the course of the last years: the right people with the right attitude, a great mix of experienced advisers and developers, as well as young potentials. The team members motivate each other and unfailingly impress the clients.

    Martin Winkler has over 13 years of experience with Microsoft Dynamics 365 for Operations and its previous releases.

    After receiving his Master's degree in Mathematical Computer Sciences at Vienna University of Technology, he gained experience as an IT Consultant at Capgemini and later, as a BI Consultant at an Austrian consulting company specializing in CFO-targeted services.

    In 2003, Martin joined Solutions Factory, a newly-founded Austrian company that specialized in Microsoft Dynamics 365 for Operations services. Starting as a developer and head of IT, he later became the head of development of up to 10 developers. From 2007 onwards, he additionally built up a team of performance experts. In 2008, the company (then FWI) became the largest Microsoft Dynamics 365 for Operations partner in Austria.

    While staying in development, he mostly worked as Technical Lead Consultant for several corporate customers with global implementations and with up to 1000 users. He also carried out numerous projects in the areas of performance and Microsoft BI for these customers.

    Together with two long-term colleagues, he founded his own company in 2013, Semantax, providing products and expert consulting services based on Microsoft Dynamics 365 for Operations. In 2014, the experts of Semantax teamed up with two further long-term colleagues with vast know-how in industry processes and corporate ERP projects to relaunch the Solutions Factory.

    Solutions Factory (www.sf-ax.com) is dedicated to shaping customer processes and to mapping them to Dynamics 365 for Operations in an efficient and optimal way. It follows its vision of contributing to the high competitive capability of European manufacturing companies. During the review of this book, the team was supporting five large customers with their Microsoft Dynamics 365 for Operations implementations.

    Over the last decade, Martin has met the author of the book at several technical conferences on Microsoft Dynamics 365 for Operations. He was impressed not only with the author's in-depth technical knowledge, but also with his understanding of the business and process sides of the ERP branch. He enjoyed reviewing the previous books by the same author and was honored to support the author with this book as well. He hopes the readers will enjoy the read as much as he did.

    www.PacktPub.com

    For support files and downloads related to your book, please visit www.PacktPub.com.

    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.comand as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.

    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.

    https://www.packtpub.com/mapt

    Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

    Why subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print, and bookmark content

    On demand and accessible via a web browser

    Customer Feedback

    Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/dp/1786467135.

    If you'd like to join our team of regular reviewers, you can e-mail us at customerreviews@packtpub.com. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products!

    Table of Contents

    Preface

    What this book covers

    What you need for this book

    Who this book is for

    Sections

    Getting ready

    How to do it…

    How it works…

    There's more…

    See also

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Errata

    Piracy

    Questions

    Starting a New Project

    Introduction

    Creating the Visual Studio Team Services project

    Getting ready

    How to do it...

    How it works...

    See also...

    Connecting Visual Studio to Visual Studio Team Services

    Getting ready

    How to do it...

    How it works...

    There's more...

    See also

    Creating a new Model and Packages

    Getting ready

    How to do it...

    How it works...

    There's more...

    Prefixes and naming conventions

    Configuring project and build options

    Getting ready

    How to do it...

    Dynamics 365 for Operations' options

    The project-specific parameters

    There's more...

    Creating a Label file

    Getting ready

    How to do it...

    How it works...

    There's more...

    Data Structures

    Introduction

    Creating enumerated types

    Getting ready

    How to do it...

    How it works...

    There's more...

    Using Enums for comparison and status

    Extensibility in Base Enums

    Creating extended data types

    Getting ready

    How to do it...

    How it works...

    There's more...

    Creating setup tables

    Getting ready

    How to do it...

    How it works...

    Creating a parameter table

    How to do it...

    There's more...

    Copying and pasting methods to save time

    Optimistic concurrency and selectForUpdate

    See also

    Creating main data tables

    Getting ready

    How to do it...

    How it works...

    There's more...

    More on indexes

    See also

    Creating order header tables

    Getting ready

    How to do it...

    How it works...

    There's more...

    Creating order line tables

    How to do it...

    How it works...

    See also

    Creating the User Interface

    Introduction

    Creating the menu structure

    Getting ready

    How to do it...

    How it works...

    Creating a parameter form

    How to do it...

    How it works...

    There's more...

    See also

    Creating menu items

    Getting ready

    How to do it...

    How it works...

    Creating setup forms

    How to do it...

    How it works...

    There's more...

    Creating details master (main table) forms

    How to do it...

    How it works...

    Creating a details transaction (order entry) form

    How to do it...

    How it works...

    Creating form parts

    Getting ready

    How to do it...

    How it works...

    Create tiles with counters for the workspace

    Getting ready

    How to do it...

    How it works...

    There's more...

    Creating a workspace

    How to do it...

    How it works...

    There's more...

    Application Extensibility, Form Code-Behind, and Frameworks

    Introduction

    Creating a handler class using the Application Extension factory

    Getting ready

    How to do it...

    How it works...

    There's more...

    See also...

    Hooking up a number sequence

    Getting ready

    How to do it...

    How it works...

    Number sequence set up

    Hooking up the number sequence

    There's more...

    Creating a create dialog for details transaction forms

    Getting ready

    How to do it...

    How it works...

    Creating a SysOperation process

    How to do it...

    How it works...

    There's more...

    Executing code using the batch framework

    Calling a process from a form

    Using the data contract to make changes to the dialog

    Adding an interface to the SysOperation framework

    Getting ready

    How to do it...

    How it works...

    Business Intelligence

    Introduction

    Creating aggregate dimensions

    Getting ready

    How to do it...

    How it works...

    See also

    Creating aggregate measures

    Getting ready

    How to do it...

    How it works...

    Creating aggregate data entities

    Getting ready

    How to do it...

    How it works...

    Creating and using key performance indicators

    Getting ready

    How to do it...

    How it works...

    There's more...

    Security

    Introduction

    Creating privileges

    Getting ready

    How to do it...

    How it works...

    There's more...

    Impact on licensing

    See also

    Creating duties

    How to do it...

    How it works...

    There's more...

    Creating security roles

    How to do it...

    How it works...

    See also...

    Creating policies

    How to do it...

    How it works...

    There's more...

    See also...

    Leveraging Extensibility

    Introduction

    Extending standard tables without customization footprint

    Getting ready

    How to do it...

    How it works...

    There's more...

    Creating data-event handler methods

    Getting ready

    How to do it...

    How it works...

    There's more...

    How to customize a document layout without an over-layer

    How to do it...

    How it works...

    There more...

    Creating event handler methods

    Getting ready

    How to do it...

    How it works...

    Extending standard forms without customization footprint

    Getting ready

    How to do it...

    How it works...

    There's more...

    Using a form event handler to replace a lookup

    Getting ready

    How to do it...

    How it works...

    Creating your own query functions

    How to do it...

    How it works...

    Data Management, OData, and Office

    Introduction

    Creating a data entity

    Getting ready

    How to do it...

    How it works...

    There's more...

    See also

    Extending standard data entities

    Getting ready

    How to do it...

    How it works...

    There's more...

    Importing data through Data Import/Export Framework

    Getting ready

    How to do it...

    How it works...

    See also

    Reading, writing, and updating data through OData

    Getting ready

    How to do it...

    How it works...

    See also

    Consuming and Exposing Services

    Introduction

    Creating a service

    Getting ready

    How to do it...

    How it works...

    Consuming a Dynamics 365 for Operations SOAP service

    Getting ready

    How to do it...

    How it works...

    See also

    Consuming a Dynamics 365 for Operations JSON service

    Getting ready

    How to do it...

    How it works...

    There's more...

    See also...

    Consuming an external service within Dynamics 365 for Operations

    Getting ready

    How to do it...

    How it works...

    There's more...

    Extensibility Through Metadata and Data Date-Effectiveness

    Introduction

    Using metadata for data access

    Getting ready...

    How to do it...

    How it works...

    Using Interfaces for extensibility through metadata

    Getting ready...

    How to do it...

    How it works...

    Making data date-effective

    Getting ready...

    How to do it...

    How it works...

    There's more...

    Unit Testing

    Introduction

    Creating a Form Adaptor project

    Getting ready

    How to do it...

    How it works...

    Creating a Unit Test project

    Getting ready

    How to do it...

    How it works...

    Creating a Unit Test case for code

    Getting ready

    How to do it...

    How it works...

    Creating a test case from a task recording

    Getting ready

    How to do it...

    How it works...

    Automated Build Management

    Introduction

    Creating a Team Services Build Agent Queue

    Getting ready

    How to do it...

    How it works...

    Setting up a build server

    Getting ready

    How to do it...

    How it works...

    There's more...

    See also

    Managing build operations

    Getting ready

    How to do it...

    How it works...

    Releasing a build to User Acceptance Testing

    Getting ready

    How to do it...

    How it works...

    Servicing Your Environment

    Introduction

    Applying metadata fixes

    Getting ready

    How to do it...

    How it works...

    There's more...

    See also

    Applying binary updates

    Getting ready

    How to do it...

    How it works...

    See also

    Servicing the build server

    Getting ready

    How to do it...

    How it works...

    Servicing the Sandbox - Standard Acceptance Test environment

    Getting ready

    How to do it...

    How it works...

    There's more...

    Servicing production

    See also

    Workflow Development

    Introduction

    Creating a workflow type

    Getting ready

    How to do it...

    How it works...

    See also...

    Creating a workflow approval

    Getting ready

    How to do it...

    How it works...

    Creating a manual workflow task

    Getting ready

    How to do it...

    How it works...

    Hooking up a workflow to the user interface

    Getting ready

    How to do it...

    How it works...

    Creating a sample workflow design

    Getting ready

    How to do it...

    How it works...

    State Machines

    Introduction

    Creating a state machine

    Getting ready

    How to do it...

    How it works...

    Creating a state machine handler class

    Getting ready

    How to do it...

    How it works...

    There's more...

    Using menu items to control a state machine

    Getting ready

    How to do it...

    How it works...

    Hooking up the state machine to a workflow

    Getting ready

    How to do it...

    How it works...

    There's more...

    Extending Microsoft Dynamics 365 for Operations Cookbook

    Copyright © 2017 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: May 2017

    Production reference: 1120517

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham 

    B3 2PB, UK.

    ISBN 978-1-78646-713-3

    www.packtpub.com

    Preface

    Microsoft Dynamics 365 for Operations  is an ERP solution for complex single-site, multi-site, and multi-language global enterprises. This flexible and agile solution provides advanced functionality for manufacturing, retail, public sector, and service sector industries. Not only does this solution provide a strong set of built-in functionality, it also provides an industry-leading integrated development environment, allowing an organization to provide even higher levels of fit. This book should be in the tool belt of any software engineer who works with or is about to embark on a career with Dynamics 365 for Operations.

    This provides software engineers and those involved in developing solutions within Dynamics 365 for Operations with a toolkit of practical recipes for common development tasks, with important background information to provide deep insight to allow the recipes to be adapted and extended for your own use.  Even for experienced software engineers, this book will provide a good source of reference for efficient software development.

    For those moving from Microsoft Dynamics AX 2012, we cover critical changes in how software is adapted, how to use the new extensibility features of Microsoft Dynamics 365 for Operations, and tips on how to use them in a practical way. We also cover the fundamental changes in the physical structure of the application metadata, the application development life cycle, and how we fit in with the new cloud-first development paradigm with Lifecycle services and Visual Studio Team Services. Integration will be a concern to AX developers, and we cover this in detail with working examples of code that can be adapted to your own needs.

    In order to facilitate this, the book follows the development of a solution as a means to explain the design and development of tables, classes, forms, BI, menu structures, workflow, and security. We begin at the start of the development process by setting up a Visual Studio Team Services project, integrating Lifecycle services, and explaining new concepts such as Packages, Models, Projects, and what happened to layers. The book progresses with chapters focused on creating the solution in a practical order, but it is written in such a way that each recipe can be used in isolation as a pattern to follow.

    The sample solution was designed and developed as the book was written and is available for download. There is a sample Operations project, OData C# integration test project, and a C# project for using web services supplied by Microsoft Dynamics 365 for Operations.

    With this comprehensive collection of recipes, you will be armed with the knowledge and insight you need to develop well-designed solutions that will help your organization to get the most value from this comprehensive solution for both the current and the upcoming releases of Microsoft Dynamics 365 for Operations.

    What this book covers

    Chapter 1, Starting a New Project, covers setting up a new Visual Studio Team Service project, integrating with Lifecycle Services, and creating a Microsoft Dynamics 365 for Operations package and model.

    Chapter 2, Data Structures, contains common recipes for creating data structure elements such as tables, enumerated data types, and extended data types. The recipes are written to patterns, guiding you through the steps you would take when creating the types of table used in Microsoft Dynamics 365 for Operations application development.

    Chapter 3, Creating the User Interface, explains how to create the user interface elements such as menus, forms, form parts, tiles, and workspaces. This chapter includes recipes for each of the main types of user interfaces used when creating or extending Dynamics 365 for Operations with practical guidance and tips on how to do this efficiently.

    Chapter 4, Application Extensibility, Form Code-Behind, and Frameworks, helps us step into writing the business logic behind our user interface and understand how to write code designed to be extensible, allowing other parties to extend our code with the over-layering that can version-lock customers. We also cover the SysOperation framework, using which processes are developed, and we'll see how to add a user interface to them.

    Chapter 5, Business Intelligence, covers the creation of a business intelligence project that can be used to create powerful dashboards in Microsoft Power BI. The recipes in this chapter cover the creation of aggregate dimensions, measures, data entities, and KPIs in a real-world context. This is done using the sample vehicle management application that is created through the course of this book.

    Chapter 6, Security, explains the security model design in Microsoft Dynamics 365 for Operations and provides recipes for the creation of the elements used in security. The recipes augment the standard documentation in order to provide real-world examples on how to create and model Dynamics 365 for Operations security.

    Chapter 7, Leveraging Extensibility, shows how extensibility can be said to be one of the biggest changes in Dynamics 365 for Operations. This chapter pays special attention to the key aspects of how to use extend the standard application without becoming version locked in a customized solution.

    Chapter 8, Data Entity Extensibility, OData, and Office, covers the many ways in which we integrate with the world outside of Dynamics 365 for Operations. This covers how to create and extend data entities, work with Microsoft Office, and use OData to read, write, and update data in Dynamic 365 for Operations from a C# project.

    Chapter 9, Consuming and Exposing Services, provides recipes for creating a service from within Dynamics 365 for Operations, consuming external services, and also on consuming Dynamics 365 for Operations services in C# using SOAP and JSON. All this is covered using practical examples that should easily translate into your own specific requirements.

    Chapter 10, Extensibility through Metadata and Data Date-Effectiveness, pushes extensibility even further by showing how we can use metadata stored in data to put more power in the hands of system administrators. We also cover how to make our tables date effective.

    Chapter 11, Unit Testing, provides recipes to show how to create unit tests and how they are used with the application life cycle. This chapter covers an insight into test-driven development, automated unit testing on the build server, and how to create and use the task recorder to create test cases.

    Chapter 12 , Automated Build Management, helps us move more into application life cycle management where this chapter provides recipes for setting up and using a build server.

    Chapter 13, Servicing Your Environment, provides practical recipes that are intended to augment the standard documentation provided by Microsoft in order to provide real-world examples on how we service our Dynamics 365 for Operations environments.

    Chapter 14, Workflow, covers the development of workflow approvals and tasks in Dynamics 365 for Operations. The recipes are given context by continuing to work with the sample application that is created through the course of this book, effectively explaining state management, which is easily misunderstood.

    Chapter 15, State Machines, covers state machines, which is another new feature in Dynamics 365 for Operations. This chapter covers all key areas of this new feature, explaining when and how to use this feature appropriately.

    What you need for this book

    In order to gain access to Microsoft Dynamics 365 for Operations, you need to be either a Microsoft partner or customer. To sign up for a gain access  as a partner, you can refer to Lifecycle Services for Dynamics 365 for Operations partners at https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/lifecycle-services/getting-started-lcs.

    To sign up for a subscription as a customer, refer to Lifecycle Services for Dynamics 365 for Operations partners at https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/lifecycle-services/getting-started-lcs.

    You will need to download or deploy a Dynamics 365 for Operations development VM in Azure. To run the VM locally, you will need at least 100 GB free space available and a minimum of 12 GB free memory, ideally 24 GB. It will run on as little as 8 GB of assigned memory, but the performance will suffer as a result.

    The official system requirements are as follows:

    System requirements (https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/get-started/system-requirements )

    Development system requirements (https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/dev-tools/development-system-requirements)

    Who this book is for

    If you are a software developer new to Dynamics 365 for Operations programming or an experienced software engineer migrating from its predecessor, Dynamics AX, this book is an ideal tutorial to help you avoid the common pitfalls and make the most of this advanced technology. This book is also useful if you are a solution architect or technical consultant, as it provides a deeper insight into the technology behind the solution.

    Sections

    In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also).

    To give clear instructions on how to complete a recipe, we use these sections as follows:

    Getting ready

    This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

    How to do it…

    This section contains the steps required to follow the recipe.

    How it works…

    This section usually consists of a detailed explanation of what happened in the previous section.

    There's more…

    This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

    See also

    This section provides helpful links to other useful information for the recipe.

    Conventions

    In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

    Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: This should have created a folder called Base Enums.

    A block of code is set as follows:

    New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: In the Add New Item dialog, select Data Model from the left-hand list and Query from the right.

    Warnings or important notes appear in

    Enjoying the preview?
    Page 1 of 1