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
control with the following properties to the bottom of the group:Property
Value
Name
CompanyColor
AutoDeclaration
Yes
LookupButton
Always
ShowZero
No
ColorScheme
RGB
Label
Company color
3...