In this recipe, we will be creating a color lookup. As an example, we will create the possibility to choose a color in the Company information form, which might be used to define different colors for each Dynamics AX company. That's one of my favorites and is very useful in Dynamics AX multi-company installations. Normally, I use additional code, which reads the user setting and changes the background color of all forms in the same company. This allows users to easily identify in which company they are and prevents incorrect postings.
Open the CompanyInfo table in AOT, and create a new field with properties:
Property
Value
Type
Integer
Name
CompanyColor
ExtendedDataType
CCColor
Open the CompanyInfo form in AOT, and add a new IntEdit control into the TopPanel group right after the GroupName group. Set the following properties:
Property
Value
Name
CompanyColor
AutoDeclaration
Yes
Label
Company color
LookupButton
Always
ShowZero
No
ColorScheme...