AX / D365FO – How to Hide Enum values on a Form Lookup x++

Suppose you have a Form with an enum control ABC which contains values A,B,C. you want to hide last value of enum “C” while displaying it on the form.

You have 2 ways to reach the result :

Override the “Run” method in your Form (Preferred solution)

public void run()
{
    super();

    YourEnumControl.delete(enum2str(ABC::C));
}

Override the “Enter” method of that enum control at form level

public void enter()
{
   super();

   this.delete(enum2str(ABC::C));
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s