AX / D365FO – Enable/Disable Form controls through extension – X++

You can use extension to enable or disable a Form Control.

In this example I will show how to disable a Form Control button (LineStripNew button) in an extension class od SalesTable Form

[ExtensionOf(formdatasourceStr(SalesTable, SalesTable)) ]

final class SalesTable_SalesTable_DLXFormDS_Extension
{
public int active()
{
int ret = next active();
FormControl LineStripNew = this.formrun().design().controlName(formControlStr(SalesTable, LineStripNew)) as FormControl;
LineStripNew.enabled(false);

}
}

Leave a comment