Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Odd code in AX #2: control:: enum on forms

Klaas Deforche Profile Picture Klaas Deforche 2,433

A somewhat non-intuitive way of accessing controls on a form is using a built in enum named ‘control’. This enum automatically contains all controls of you form (tabs, buttons, etc), and you can reference them by name.

So, if for example your button is called ‘ButtonFunctions’, you can set the property ‘enabled’ to false like this:

element.control(Control::ButtonFunctions).enabled(false);

The main advantage here is that you don’t have to set the property autodeclaration to yes.

Comments

*This post is locked for comments