Wednesday, December 17, 2008

Hide an element from the combo box

I have an enum with values Element1, Element2 and Element3. Now this enum is being used on two different locations what the requirement is that i have to add another element Element4 in to the enum but this should only reflect on one location.

Answer
Let say you you two forms where this enum is reflected, namely Form1 and Form2. In order to hide an element from Form1 and continue showing it on Form2 go to form design and then access that combo box control. Override the enter() method of that combo box and write this line to delete the element from it.

combobox:enter()
{
super();
this.delete(enum2str(BaseEnum::Element4));
}

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...