Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Dynamics 365 for Finance and Operations Development Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Dynamics 365 for Finance and Operations Development Cookbook

Dynamics 365 for Finance and Operations Development Cookbook

By : Abhimanyu Singh, Agarwal
2.7 (3)
close
close
Dynamics 365 for Finance and Operations Development Cookbook

Dynamics 365 for Finance and Operations Development Cookbook

2.7 (3)
By: Abhimanyu Singh, 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)
close
close
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Enhancing the data consistency checks


It is highly recommended that you run the standard Dynamics 365 for Finance and Operations data consistency checks from time to time, which can be found by navigating to System administration | Periodic tasks | Database | Consistency check, to check the system's data integrity. This function finds orphan data, validates parameters, and does many other things, but it does not do everything. The good thing is that it can be easily extended.

In this recipe, we will see how we can enhance the standard Dynamics 365 for Finance and Operations consistency check to include more tables in its data integrity validation.

Getting ready

Before we start, we need to create an invalid setup in order to make sure that we can simulate data inconsistency. Navigate to Fixed assets | Setup | Value models and create a new model, for instance, TEST, as shown in the following screenshot:

Navigate to Fixed assets | Setup | Fixed asset posting profiles and under the Ledger accounts group, create a new record with the newly created value model for any of the posting types, as shown here:

Go back to the Value models form and delete the previously created value model. Now, we have a nonexistent value model in the fixed asset posting settings.

How to do it...

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

  1. In the Dynamics 365 Project, create a new class named AssetConsistencyCheck with the following code snippet:
class AssetConsistencyCheck extends SysConsistencyCheck 
{ 
   client server static ClassDescription description() 
    { 
      return "Fixed assets"; 
    } 
 
    client server static HelpTxt helpText() 
    { 
      return "Consistency check of the fixed asset module"; 
    } 
 
    public Integer executionOrder() 
    { 
      return 1; 
    } 
 
    public void run() 
    { 
      this.kernelCheckTable(tableNum(AssetLedgerAccounts)); 
    } 
 
} 
  1. Navigate to System administration | Periodic tasks | Database | Consistency check, select the newly created Fixed assets option from the Module drop-down list, and click on OK to run the check, as shown here:
  1. Now, the message displayed in the Infolog window should complain about the missing value model in the fixed assets posting settings, as shown in the following screenshot:

How it works...

The consistency check in Dynamics 365 for Finance and Operations validates only the predefined list of tables for each module. The system contains a number of classes derived from SysConsistencyCheck. For example, the CustConsistencyCheck class is responsible for validating the Accounts receivable module, LedgerConsistencyCheck for validating General ledger, and so on.

In this recipe, we created a new class named AssetConsistencyCheck, extending the SysConsistencyCheck class for the fixed asset module. The following methods were created:

  • description(): This provides a name to the consistency check form.
  • helpText(): This displays some explanation about the check.
  • executionOrder(): This determines where the check is located in the list.
  • run(): This holds the code to perform the actual checking. Here, we use the kernelCheckTable() member method, which validates the given table.

There's more...

The classes that we just mentioned can only be executed from the main Consistency check form. Individual checks can also be invoked as standalone functions. We just need to create an additional method to allow the running of the class:

 static void main(Args _args) 
{ 
  SysConsistencyCheckJob consistencyCheckJob; 
  AssetConsistencyCheck  assetConsistencyCheck; 
 
  consistencyCheckJob = new SysConsistencyCheckJob( 
   classIdGet(assetConsistencyCheck)); 
 
  if (!consistencyCheckJob.prompt()) 
 { 
   return; 
 } 
 
  consistencyCheckJob.run(); 
} 
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon

Create a Note

Modal Close icon
You need to login to use this feature.

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note