Reader small image

You're reading from  Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition

Product typeBook
Published inAug 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781786468864
Edition4th Edition
Languages
Right arrow
Authors (2):
Abhimanyu Singh
Abhimanyu Singh
author image
Abhimanyu Singh

Abhimanyu Singh works as a Microsoft Dynamics 365 for Finance and Operations consultant. Since the start of his career in 2012, he has worked in the development and designing of business solutions for customers in supply chain management, banking, and finance domain using Microsoft technologies. He has several certifications, including the Microsoft Certified Dynamics Specialist certification.
Read more about Abhimanyu Singh

Deepak Agarwal
Deepak Agarwal
author image
Deepak Agarwal

Deepak Agarwal is a Microsoft Certified Professional who has more than 6 years of relevant experience. He has worked with different versions of Axapta, such as AX 2009, AX 2012, and Dynamics 365. He has had a wide range of development, consulting, and leading roles, while always maintaining a significant role as a business application developer. Although his strengths are rooted in X++ development, he is a highly regarded developer and expert in the technical aspects of Dynamics AX development and customization. He has also worked on base product development with the Microsoft team. He was awarded the Most Valuable Professional (MVP) award from Microsoft for Dynamics AX four times in a row, and he has held this title since 2013. He shares his experience with Dynamics AX on his blog: Axapta V/s Me Deepak has also worked on the following Packt books: Microsoft Dynamics AX 2012 R3 Reporting Cookbook Dynamics AX 2012 Reporting Cookbook Microsoft Dynamics AX 2012 Programming: Getting Started
Read more about Deepak Agarwal

View More author details
Right arrow

Chapter 3. Working with Data in Forms

In this chapter, we will cover the following recipes:

  • Using a number sequence handler
  • Creating a custom filter control
  • Creating a custom instant search filter
  • Building a selected/available list
  • Creating a wizard
  • Processing multiple records
  • Coloring records
  • Adding an image to records

Introduction


This chapter basically supplements the previous one and explains data organization in forms in the new Dynamics 365 for Finance and Operations. It shows how to add custom filters to forms to allow users to filter data and create record lists for quick data manipulation.

This chapter also discusses how the displaying of data can be enhanced by adding icons to record lists and trees, and how normal images can be stored along with the data by reusing the existing Dynamics 365 for Finance and Operations application objects.

A couple of recipes will show you how to create wizards in the new Dynamics 365 for Finance and Operations to guide users through complex tasks. This chapter will also show several approaches to capturing user-selected records on forms for further processing, and ways to distinguish specific records by coloring them.

Using a number sequence handler


As already discussed in the Creating a new number sequence recipe in Chapter 1, Processing Data, number sequences are widely used throughout the system as a part of the standard application. Dynamics 365 for Finance and Operations also provides a special number sequence handler class to be used in forms. It is called NumberSeqFormHandler and its purpose is to simplify the usage of record numbering on the user interface. Some of the standard Dynamics 365 for Finance and Operations forms, such as Customers or Vendors, already have this feature implemented.

This recipe shows you how to use the number sequence handler class. Although in this demonstration we will use an existing form, the same approach will be applied when creating brand new forms.

For demonstration purposes, we will use the existing Customer groups form located in Accounts receivable | Setup | Customers and change the Customer group field from manual to automatic numbering. We will use the number...

Creating a custom filter control


Filtering forms in Dynamics 365 for Finance and Operations is implemented in a variety of ways. As part of the standard application, Dynamics 365 for Finance and Operations provides various filtering options, such as Filter by Selection, Filter by Grid, or Advanced Filter/Sort located in the toolbar, which allow you to modify the underlying query of the currently displayed form. In addition to the standard filters, the Dynamics 365 for Finance and Operations list pages normally allow quick filtering on most commonly used fields. Besides that, some of the existing forms have even more advanced filtering options, which allow users to quickly define complex search criteria.

Although the latter option needs additional programming, it is more user-friendly than standard filtering and is a very common request in most of the Dynamics 365 for Finance and Operations implementations.

In this recipe, we will learn how to add custom filters to a form. We will use the Main...

Creating a custom instant search filter


The standard form filters and the majority of customized form filters in Dynamics 365 for Finance and Operations are only applied once the user presses a button or a key. This is acceptable in most cases, especially if multiple criteria are used. However, when the result retrieval speed and usage simplicity has priority over system performance, it is possible to set up the search so that the record list is updated instantly when the user starts typing.

In this recipe, to demonstrate the instant search, we will modify the Vendor group form. We will add a custom Name filter, which will update the group list automatically when the user starts typing. We will need to overlay the Vendor group form, as the methods that we will be using for instant search don't yet have an event listener provided by Microsoft.

How to do it...

Carry out the following steps in order to complete this recipe:

  1. Create a new project in Visual Studio, open the VendGroup form, and add...

Building a selected/available list


Frequent users might note that some of the Dynamics 365 for Finance and Operations forms contain two sections placed next to each other and allow the moving of items from one side to the other. Normally, the right section contains a list of available values and the left one contains the values that have been chosen by the user. Buttons in the middle the allow the moving of data from one side to another. Double-click and drag and drop mouse events are also supported. Such design improves the user's experience, as data manipulation becomes more user-friendly.

Some of the examples in the standard application can be found at General ledger | Chart of accounts | Dimensions | Financial dimension sets or System administration | Users | User groups.

This functionality is based on the SysListPanelRelationTableCallBack application class. Developers only need to create its instance with the required parameters and the rest is done automatically.

This recipe will show...

Creating a wizard


Wizards in Dynamics 365 for Finance and Operations are used to help a user to perform a specific task. An example of a standard Dynamics 365 for Finance and Operations wizards is the Number Sequence Wizard.

Normally, a wizard is presented to a user as a form with a series of steps. During the wizard run, all the user's inputs are collected and committed to the database. Then, the user presses the Finish button on the last wizard page.

In this recipe, we will create a new wizard to create main accounts. First, we will use the standard Dynamics 365 for Finance and Operations wizard to create a framework, and then we will add some additional controls manually.

How to do it...

Carry out the following steps in order to complete this recipe:

  1. In the Development Workspace, create a new Dynamics 365 for Operations project.
  2. Create a new Class named wizard that extends SysWizard:
  1. Create a new Form named wizard, select a design, and apply the design pattern Wizard:
  2. Address BP Warnings:
  • Design...

Processing multiple records


In Dynamics 365 for Finance and Operations, by default, most of the functions available on forms are related to currently selected single record. However, on many Dynamics 365 for Finance and Operations forms you will find a multiple record selection option, but at the same time ,you will be able to perform some certain operations only. So, to perform a specific operation on all selected records, some modification is required.

In this recipe, we will explore how to process multiple records at the same time. You can modify an existing process for the same. For this demonstration, we will add a new button to the action pane on the Vend Table form to show multiple selected accounts in the Infolog window.

How to do it...

For this recipe, we will extend the VendTable form. Currently, we don't have an option to put multiple vendors on hold in a single click. So, we will add a new button there to process all selected vendors. Carry out the following steps in order to complete...

Coloring records


One of Dynamics 365 for Operation's exciting features, which can enhance user experience, is the ability to color individual records. Some users might find the system more intuitive and user-friendly through this modification.

For example, emphasizing the importance of disabled records by highlighting terminated employees or former customers in red allows users to identify relevant records at a glance. Another example is to show processed records, such as posted journals or invoiced sales orders, in green.

Getting ready

In this recipe, we will learn how to change a record's color. We will use one created earlier form the PktDisabledUser form located in System administration | Users | Disabled Users with color and add a method to show disabled users in red.

How to do it...

  1. Add a new project in your solution.
  2. Go to application explorer and search for the PktDisabledUser form; add this form to your project.
  3. Now, override the displayOption() method in its UserInfo data source with...

Adding an image to records


Company-specific images in Dynamics 365 for Finance and Operations can be stored along with the data in the database tables. They can be used for different purposes, such as a company logo that is displayed in every printed document, employee photos, inventory pictures, and so on.

Images are binary objects and they can be stored in the container table fields. In order to make the system perform better, it is always recommended to store images in a separate table so that it does not affect the retrieval speed of the main data.

One of the most convenient ways to attach images to record is to use the Document handling feature of Dynamics 365 for Finance and Operations. It does not require any change in the application. However, the Document handling feature is a very generic way of attaching files to record and might not be suitable for specific circumstances.

Another way of attaching images to records is to utilize the standard application objects, though minor application...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition
Published in: Aug 2017Publisher: PacktISBN-13: 9781786468864
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Abhimanyu Singh

Abhimanyu Singh works as a Microsoft Dynamics 365 for Finance and Operations consultant. Since the start of his career in 2012, he has worked in the development and designing of business solutions for customers in supply chain management, banking, and finance domain using Microsoft technologies. He has several certifications, including the Microsoft Certified Dynamics Specialist certification.
Read more about Abhimanyu Singh

author image
Deepak Agarwal

Deepak Agarwal is a Microsoft Certified Professional who has more than 6 years of relevant experience. He has worked with different versions of Axapta, such as AX 2009, AX 2012, and Dynamics 365. He has had a wide range of development, consulting, and leading roles, while always maintaining a significant role as a business application developer. Although his strengths are rooted in X++ development, he is a highly regarded developer and expert in the technical aspects of Dynamics AX development and customization. He has also worked on base product development with the Microsoft team. He was awarded the Most Valuable Professional (MVP) award from Microsoft for Dynamics AX four times in a row, and he has held this title since 2013. He shares his experience with Dynamics AX on his blog: Axapta V/s Me Deepak has also worked on the following Packt books: Microsoft Dynamics AX 2012 R3 Reporting Cookbook Dynamics AX 2012 Reporting Cookbook Microsoft Dynamics AX 2012 Programming: Getting Started
Read more about Deepak Agarwal