AX / D365FO – How To Call A Form Using X++

Inside my form I want to open another form. To achieve this goal without writing code I can use a Display Menu item, but I can also use a normal button to open it.

Using a normal button requires write some X++ code.

First create a button on your form’s Button group

Then override clicked() method

Use this example to open the form

    class FormButtonControl1
        /// <summary>
        /// </summary>
        public void clicked()
            Args    args;
            FormRun formRun;


            //Call the form directly.
            Args = new Args(formStr(ots_GuidedSalesOrderEntryRulesZTEST)); //Write your form name here
            formRun = New FormRun(Args);

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 )

Facebook photo

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

Connecting to %s