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

Creating a color picker lookup


In Dynamics 365 for Finance and Operations, the color selection dialog boxes are used in various places, allowing the user to select and store a color code in a table field. Then the stored color code can be used in various places to color data records, change form backgrounds, set colors for various controls, and so on.

In this recipe, we will create a color lookup. For demonstration purposes, we will add an option to set a color for each legal entity in the system.

How to do it...

  1. In the AOT, open the CompanyInfo table and create a new field with the following properties:

Property

Value

Type

Integer

Name

CompanyColor

ExtendedDataType

CCColor

  1. Open the OMLegalEntity form, locate the TopPanel group in Design | Tab | General, and add a new IntEdit control with the following properties to the bottom of the group:

Property

Value

Name

CompanyColor

AutoDeclaration

Yes

LookupButton

Always

ShowZero

No

Label

Company color

  1. In the same form, create a new method with the following code snippet...