Creating a color picker lookup

In Dynamics AX, the color selection dialog boxes are used in various places, allowing the user to select and store a color code in a table. The stored color code can be used in various scenarios, such as marking important records, changing the control's background, 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

  2. Open the OMLegalEntity form, locate the TopPanel group in Body | Content | Tab | General, and add a new IntEdit ...

Get Microsoft Dynamics AX 2012 Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.