AX / D365FO – Hide a control in a Form by extension

I need to hide a form control.
The form in question is the whsloadtable (All Loads) and the field is the Shipping Carrier

To hide it I can use event handlers so I enter the WHSLOADTABLE Form, open the datasource, click on “Events” and right-click on the “OnActivated” event. Then click on “Copy event handler method”

Now create ane mpty class and paste the code you’ve just copied.

Then write code shown below

public class myclass
   [FormDataSourceEventHandler(formDataSourceStr(WHSLoadTable, WHSLoadTable), FormDataSourceEventType::Activated)]
    public static void WHSLoadTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)

        FormRun             element       = sender.formRun();
        FormControl         carrierCode   =, WHSLoadTable_CarrierCode)); //Put here the name of the Form control. In this example the name is WHSLoadTable_CarrierCode


Leave a Reply

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

You are commenting using your 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