Book Image

Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition

By : Abhimanyu Singh, Deepak Agarwal
Book Image

Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition

By: Abhimanyu Singh, Deepak Agarwal

Overview of this book

Microsoft Dynamics 365 for Finance and Operations has a lot to offer developers. It allows them to customize and tailor their implementations to meet their organization’s needs. This Development Cookbook will help you manage your company or customer ERP information and operations efficiently. We start off by exploring the concept of data manipulation in Dynamics 365 for Operations. This will also help you build scripts to assist data migration, and show you how to organize data in forms. You will learn how to create custom lookups using Application Object Tree forms and generate them dynamically. We will also show you how you can enhance your application by using advanced form controls, and integrate your system with other external systems. We will help you script and enhance your user interface using UI elements. This book will help you look at application development from a business process perspective, and develop enhanced ERP solutions by learning and implementing the best practices and techniques.
Table of Contents (18 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Preface

As a Dynamics 365 for Finance and Operations developer, your responsibility is to deliver all kinds of application customization, whether small adjustments or a bespoke modules. Dynamics 365 for Finance and Operations is a highly customizable system and requires a significant amount of knowledge and experience to deliver quality solutions. One goal can be achieved in multiple ways, and there is always the question of which way is the best.

This book takes you through numerous recipes to help you with daily development tasks.

Each recipe contains detailed step-by-step instructions along with the application screenshots and in-depth explanations. The recipes cover multiple Dynamics 365 for Financial and Operations modules, so, at the same time, the book provides an overview of the functional aspects of the system for developers.

What this book covers

Chapter 1, Processing Data, focuses on data manipulation. It explains how to build data queries, check and modify existing data, read and write external files, and use data effectively.

Chapter 2, Working with Forms, covers various aspects of building forms in Dynamics 365 for Finance and Operations. In this chapter, dialogs and their events are explained. Also, various useful features, such as splitters, tree controls, and checklists, are explained.

Chapter 3, Working with Data in Forms, basically supplements Chapter 2, Working with Forms, and explains the data organization in forms. The examples in this chapter include instructions for building filter controls on forms, processing multiple records, and working with images and colors.

Chapter 4, Building Lookups, covers all kinds of lookups in the system. This chapter starts with a simple, automatically generated lookup, continues with more advanced ones, and finishes with standard Windows lookups, such as the file selection dialog and the color picker.

Chapter 5, Processing Business Tasks, explains how to use the Dynamics 365 for Finance and Operations business logic API. In this chapter, topics such as how to process journals, purchase orders, and sales orders are discussed. Other features, such as posting ledger vouchers, modifying transaction texts, and creating electronic payment formats, are included as well.

Chapter 6, Data Management, explains the data management and data entity concepts, how to build a data entity, data packages, and import and export in Dynamics 365 for Financial and Operations.

Chapter 7, Integration with Microsoft Office, explains how to configure and use the Excel Data Connector add-in, and design Excel workbooks with the data feed from Dynamics 365 from Operations using OData. It also covers how to use the export API and document management.

Chapter 8, Integration with Power BI, explains the configuration of Power BI and its integration with Dynamics 365 for Financial and Operations to develop interactive dashboards and embed them in Dynamics 365 for Financial and Operations workspaces.

Chapter 9, Integration with Services, explains how to use services in Dynamics 365 for Financial and Operations. This chapter covers how to create services, authentication, SOAP applications, JSON applications, and OData services. It also demonstrates how to consume external services.

Chapter 10, Improving Development Efficiency and Performance, presents a few ideas on how to make daily development tasks easier. It discusses how system performance can be improved by following several simple rules. This chapter explains how to calculate code execution time, how to write efficient SQL statements, and how to properly cache display methods.

Exceptions and considerations

The code in this book follows the best practice guidelines provided by Microsoft, but there are some exceptions:

  • No text labels were used to make the code clear
  • No three-letter code was used in front of each new AOT object
  • No configuration or security keys were used
  • Object properties that are not relevant to the topic being discussed are not set

Also, here are some considerations that you need to keep in mind when reading this book:

  • Each recipe only demonstrates the principle and is not a complete solution
  • The data in your environment might not match the data used in the recipes, so the code might have to be adjusted appropriately
  • For each recipe, the assumption is that no other modifications are present in the system, unless it is explicitly specified
  • The code might not have all the possible validations that are not relevant to the principle being explained
  • The code might have more variables than required in order to ensure that it is clear for all audiences
  • Sometimes, unnecessary code wrapping is used to make sure the code fits into the page width of this book and is easily readable

What you need for this book

All the coding examples were performed in a Microsoft Azure-hosted Microsoft Dynamics 365 for Financial and Operations environment. The following list of software from the virtual image was used in this book:

  • Microsoft Dynamics 365 for Financial and Operations (Update 6)
  • Microsoft Visual studio 2015
  • Microsoft Windows Server 2015 Enterprise
  • Microsoft SQL Server 2016
  • Microsoft Power BI
  • Microsoft Office Excel 2015
  • Microsoft Office Word 2015
  • Microsoft Internet Explorer
  • Windows Notepad

Although all the recipes have been tested on the previously-mentioned software, they may work on older or newer software versions with minor code adjustments. As Microsoft is continuously evolving on Dynamics 365 for Financial and Operations, we might see some differences while using the same code in older or newer updates of application. Stick to the concept and customize or extend the application.

Who this book is for

If you are a Dynamics AX developer primarily focused on delivering time-proven applications, then this book is for you. This book is also ideal for people who want to raise their programming skills above the beginner level, and, at the same time, learn the functional aspects of Dynamics 365 for Financial and Operations. Some X++ coding experience is expected.

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: "Then, to override the data source's write() method."

A block of code is set as follows:

  [FormDataSourceEventHandler(formDataSourceStr(CustGroup, 
   CustGroup), FormDataSourceEventType::Written)] 
  public void CustGroup_OnWritten(FormDataSource sender, 
  FormDataSourceEventArgs e) 
 {   
   this.numberSeqFormHandler().formMethodDataSourceWrite(); 
 }

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: "Clicking the Next button moves you to the next screen."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Dynamics-365-for-Finance-and-Operations-Development-Cookbook-Fourth-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.