Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Dynamics 365 for Finance and Operations Development Cookbook
Dynamics 365 for Finance and Operations Development Cookbook

Dynamics 365 for Finance and Operations Development Cookbook: Recipes to explore forms, look-ups and different integrations like Power BI and MS Office for your business solutions , Fourth Edition

Arrow left icon
Profile Icon Abhimanyu Singh Profile Icon Agarwal
Arrow right icon
$19.99 per month
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.7 (3 Ratings)
Paperback Aug 2017 480 pages 4th Edition
eBook
$35.99 $51.99
Paperback
$65.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Abhimanyu Singh Profile Icon Agarwal
Arrow right icon
$19.99 per month
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.7 (3 Ratings)
Paperback Aug 2017 480 pages 4th Edition
eBook
$35.99 $51.99
Paperback
$65.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$35.99 $51.99
Paperback
$65.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Dynamics 365 for Finance and Operations Development Cookbook

Working with Forms

In this chapter, we will cover the following recipes:

  • Creating dialogs using the RunBase framework
  • Handling the dialog event
  • Creating dialogs using the SysOperation framework
  • Building a dynamic form
  • Adding a form splitter
  • Creating a modal form
  • Modifying multiple forms dynamically
  • Storing the last form values
  • Using a Tree control
  • Adding the View details link
  • Selecting a Form Pattern
  • Full list of form patterns
  • Creating a new form

Introduction

Forms in Dynamics 365 for Finance and Operations represent the user interface and are mainly used to enter or modify data. They are also used to run reports, execute user commands, validate data, and so on.

Normally, forms are created using the AOT by producing a form object and adding form controls, such as tabs, tab pages, grids, groups, data fields, and images. The form's behavior is controlled by its properties or the code in its member methods. The behavior and layout of form controls are also controlled by their properties and the code in their member methods. Although it is very rare, forms can also be created dynamically from code.

In this chapter, we will cover various aspects of using Dynamics 365 for Finance and Operations forms. We start by building Dynamics 365 for Finance and Operations dialogs, which are actually dynamic forms, and then go on to...

Creating dialogs using the RunBase framework

Dialogs are a way to present users with a simple input form. They are commonly used for small user tasks, such as filling in report values, running batch jobs, and presenting only the most important fields to the user when creating a new record. Dialogs are normally created from X++ code without storing the actual layout in the AOT.

The application class called Dialog is used to build dialogs. Other application classes, such as DialogField, DialogGroup, and DialogTabPage, are used to create dialog controls. The easiest way to create dialogs is to use the RunBase framework. This is because the framework provides a set of predefined methods, which make the creation and handling of the dialog well-structured, as opposed to having all the code in a single place.

In this example, we will demonstrate how to build a dialog from code using...

Handling the dialog event

Sometimes, in the user interface, it is necessary to change the status of one field depending on the status of another field. For example, if the user marks the Show filter checkbox, then another field, Filter, appears or becomes enabled. In AOT forms, this can be done using the modified() input control event. However, if this feature is required on runtime dialogs, handling events is not that straightforward.

Often, existing dialogs have to be modified in order to support events. The easiest way to do this is, of course, to convert a dialog into an AOT form. However, when the existing dialog is complex enough, a more cost-effective solution would probably be to implement dialog event handling instead of converting into an AOT form. Event handling in dialogs is not flexible, as in the case of AOT forms; but in most cases, it does the job.

In this recipe...

Creating dialogs using the SysOperation framework

SysOperation is a framework in Dynamics 365 for Finance and Operations that allows application logic to be written in a way that supports running operations interactively or via the D365 batch server. The SysOperation framework follows the MVC (Model-View-Controller) pattern. As the name implies, the MVC pattern isolates the Model, View, and Controller components, which makes the process loosely coupled built over the SysOperation framework. Depending on parameters, the controller can execute different service operations under four main execution modes. Regardless of which mode a service is running in, the code runs on a server. This makes the minimum number of round trips between server and client.

  • Synchronous: When a service is run in synchronous mode, although it runs on a server, it freezes the Dynamics 365 for Operations...

Building a dynamic form

A standard approach to creating forms in Dynamics 365 for Finance and Operations is to build and store form objects in the AOT. It is possible to achieve a high level of complexity using this approach. However, in a number of cases, it is necessary to have forms created dynamically. In a standard Dynamics 365 for Finance and Operations application, we can see that application objects, such as the Table browser form, various lookups, or dialogs, are built dynamically. Even in Dynamics 365 for Finance and Operations, where we have a browser-based interface, every form or dialog opens in a browser only.

In this recipe, we will create a dynamic form. In order to show how flexible the form can be, we will replicate the layout of the existing Customer groups form located in the Accounts receivable module. The Customers form can be opened by navigating to Accounts...

Adding a form splitter

In Dynamics 365 for Finance and Operations, complex forms consist of one or more sections. Each section may contain grids, groups, or any other element. In order to maintain section sizes while resizing the form, the sections are normally separated by so-called splitters. Splitters are not special Dynamics 365 for Finance and Operations controls; they are Group controls with their properties modified so that they look like splitters. Most of the multisection forms in Dynamics 365 for Finance and Operations already contain splitters.

In this recipe, in order to demonstrate the usage of splitters, we will modify one of the existing forms that does not have a splitter. We will modify the Account reconciliation form in the Cash and bank management module. You can open this module by navigating to Cash and bank management | Setup | Bank group. From the following...

Creating a modal form

Often, people who are not familiar with computers and software tend to get lost among open application windows. The same can be applied to Dynamics 365 for Finance and Operations. Frequently, a user opens a form, clicks a button to open another one, and then goes back to the first one without closing the second form. Sometimes this happens intentionally, sometimes not, but the result is that the second form gets hidden behind the first one and the user starts wondering why it is not possible to close or edit the first form.

Although it is not best practice, sometimes such issues can be easily solved by making the child form a modal window. In other words, the second form always stays on top of the first one until it is closed. In this recipe, we will make a modal window from the Create sales order form.

...

Modifying multiple forms dynamically

In the standard Dynamics 365 for Finance and Operations, there is a class called SysSetupFormRun. The class is called during the run of every form in Dynamics 365 for Operations; therefore, it can be used to override one of the common behaviors for all Dynamics 365 for Finance and Operations forms. For example, different form background colors can be set for different company accounts, some controls can be hidden or added depending on specific circumstances, and so on.

In this recipe, we will modify the SysSetupFormRun class to automatically add the About Dynamics 365 for Operations button to every form in Dynamics 365 for Finance and Operations.

How to do it...

Carry out the following...

Storing the last form values

Dynamics 365 for Finance and Operations has a very useful feature that allows you to save the latest user choices per user per form, report, or any other object. This feature is implemented across a number of standard forms, reports, periodic jobs, and other objects which require user input. When developing a new functionality for Dynamics 365 for Finance and Operations, it is recommended that you keep it that way.

In this recipe, we will demonstrate how to save the latest user selections. In order to make it as simple as possible, we will use the existing filters on the Bank statement form, which can be opened by navigating to Cash and bank management | Common | Bank accounts, selecting any bank account, and then clicking on the Account reconciliation button in the Action pane. This form contains one filter control called View, which allows you to...

Using a tree control

Frequent users will notice that some of the Dynamics 365 for Finance and Operations forms use tree controls instead of the commonly used grids. In some cases, this is extremely useful, especially when there are parent-child relationships among records. It is a much clearer way to show the whole hierarchy, as compared to a flat list. For example, product categories are organized as a hierarchy and give a much better overview when displayed in a tree layout.

This recipe will discuss the principles of how to build tree-based forms. As an example, we will use the Budget model form, which can be found by navigating to Budgeting | Setup | Basic Budgeting | Budget models. This form contains a list of budget models and their submodels and, although the data is organized using a parent-child structure, it is still displayed as a grid. In this recipe, in order to demonstrate...

Adding the View details link

Dynamics 365 for Finance and Operations has a very useful feature that allows the user to open the main record form with just a few mouse clicks on the current form. The feature is called View details and is available in the right-click context menu on some controls. It is based on table relationships and is available for those controls whose data fields have foreign key relationships with other tables.

Because of the data structure's integrity, the View details feature works most of the time. However, when it comes to complex table relations, it does not work correctly or does not work at all. Another example of when this feature does not work automatically is when the display or edit methods are used on a form. In these and many other cases, the View details feature has to be implemented manually.

In this recipe, to demonstrate how it works...

Selecting a form pattern

In the latest version of Dynamics 365 for Finance and Operations, form patterns are now an integrated part of the form development experience. These patterns provide form structure based on a particular style (including required and optional controls), and also provide many default control properties. In addition to top-level form patterns, Dynamics 365 for Operations has also introduced subpatterns which can be applied to container controls, and that provide guidance and consistency for subcontent on a form, such as, on a Fast Tab.

Form patterns have made form development easier in Dynamics 365 for Finance and Operations by providing a guided experience for applying patterns to forms to guarantee that they are correct and consistent. Patterns help validate form and control structures, and also the use of controls in some places. Patterns also help guarantee...

Full list of form patterns

In the current version of Dynamics 365 for Finance and Operations, there are a total of five form patterns that we use the most:

  • Details Master
  • Form Part - Fact Boxes
  • Simple List
  • Table of Contents
  • Operational workspaces

For a full list of the forms that are currently using a particular form pattern, generate the Form Patterns report from within Microsoft Visual Studio. On the Dynamics 365 menu, expand the Add-ins option, and click Run form patterns report. A background process generates the report. After several seconds, a message box appears in Visual Studio to indicate that the report has been generated and inform you about the location of the Form Patterns report file. You can filter this file by pattern to find forms that use a particular pattern.

How...

Creating a new form

In Dynamics 365 for Finance and Operations, form creations are slightly easier than in AX2012 and earlier versions. Here, we have more tools to create any specific form using design templates. Every form plays an important role where we need to interact with the user to view, insert, update, or delete any record(s).

In this recipe, we will create a simple form using a template and add this form to one of the menus so that users can access it from the front end.

Getting ready

Let's think about a scenario where the admin needs to check all existing users in the system. Although we have one standard form for this, we cannot give access to everyone because this form also has many other options to perform...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn all about the enhanced functionalities of Dynamics 365 for Finance and Operations and master development best practices
  • Develop powerful projects using new tools and features
  • Work through easy-to-understand recipes with step-by-step instructions and useful screenshots

Description

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.

Who is this book 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 Finance and Operations. Some X++ coding experience is expected.

What you will learn

  • Explore data manipulation concepts in Dynamics 365 for Operations
  • Build scripts to assist data migration processes
  • Organize data in Dynamics 365 for Operations forms
  • Make custom lookups using AOT forms and dynamically generate them from X++ code
  • Create a custom electronic payment format and process a vendor payment using it
  • Integrate your application with Microsoft Office Suite and other external systems using various approaches
  • Export and import business data for further distribution or analysis
  • Improve your development efficiency and performance

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 11, 2017
Length: 480 pages
Edition : 4th
Language : English
ISBN-13 : 9781786468864
Vendor :
Microsoft
Languages :
Concepts :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Aug 11, 2017
Length: 480 pages
Edition : 4th
Language : English
ISBN-13 : 9781786468864
Vendor :
Microsoft
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 192.97
Implementing Microsoft Dynamics 365 for Finance and Operations
$65.99
Dynamics 365 for Finance and Operations Development Cookbook
$65.99
Extending Microsoft Dynamics 365 for Operations Cookbook
$60.99
Total $ 192.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Processing Data Chevron down icon Chevron up icon
Working with Forms Chevron down icon Chevron up icon
Working with Data in Forms Chevron down icon Chevron up icon
Building Lookups Chevron down icon Chevron up icon
Processing Business Tasks Chevron down icon Chevron up icon
Data Management Chevron down icon Chevron up icon
Integration with Microsoft Office Chevron down icon Chevron up icon
Integration with Power BI Chevron down icon Chevron up icon
Integration with Services Chevron down icon Chevron up icon
Improving Development Efficiency and Performance Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.7
(3 Ratings)
5 star 33.3%
4 star 0%
3 star 0%
2 star 33.3%
1 star 33.3%
Carlos Díaz Aug 12, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Me está ayudando en mi trabajo actual y futuro. Me gustó el tiempo de entrega y respuesta
Amazon Verified review Amazon
DNAunion Apr 28, 2018
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
I am so sick of Packt books. Not even 10 pages in reading and there are multiple errors. These books are so unprofessional; almost like authors just slap them together in a hurry to get them out the door, and don't bother to proofread the work themselves or have anyone else proofread it. If these authors and the publisher aren't going to take the time to worry about what they put out, then we shouldn't worry about what they put out and just not buy their books any more.
Amazon Verified review Amazon
Milindav Aug 31, 2018
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I did not buy this book - nor did I read it. However, I was trouble-shooting an error that a user had in their Dynamics 365 for Finance and Operations environment. The reader (a developer) followed the step by step guidelines provided in the book. She had created a PowerBI report using a direct reference to the Operational database (AXDB). She was facing errors when migrating the report from her Developer environment to the production environment.This approach prescribed in the book is wrong. User must not reference the operational database directly. User must reference Entity store. Perhaps it's a typo.I am posting this comment for awareness. And perhaps the author can change the issue in the next edition
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.