Loading...

D365 Calling - Opening AX form through X++

D365 Calling - Opening AX form through X++
static voidOpenForm_ThroughCode(Args _args)
{
    Args                            args;
    Object                          formRun;

    // open form
    args = new Args();
    args.name(formstr(FormName));
    formRun = classfactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
}

If you want to pass a record to open a form

args = newArgs();
args.record(ProjTable::find('PR00001'));
args.name(formstr(FormName));
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.run();

formRun.wait();

How to retrieve these args on caller form's init()

public voidinit()
{
    ProjTable   projTableLocal;   
    super();   
    projTableLocal = element.args().record();   

}


Call A Form Using A Menu Item

[Form]
public class rsmModel extends FormRun
{
    [Control("Button")]
    class FormButtonControlMake
    {
        /// <summary>
        /// Call the rsmMake form
        /// </summary>
        public void clicked()
        {
            Args    args;
            FormRun formRun;

            super();

            //Call the form using a Menu Item
            args = new Args();
            formRun = new menufunction(menuItemDisplayStr(rsmModel), MenuItemType::Display).create(args);
            
            formRun.init();
            formRun.run();
            formRun.wait();
        }
    }
}

 

Published on:

Learn more
Sherif Fayed
Sherif Fayed

Share post:

Related posts

Create a data maintenance strategy for Dynamics 365 finance and operations data (part two)

Welcome to part two of our series on creating a data maintenance strategy for Dynamics 365 finance and operations data. In this installment, w...

27 days ago

Create a data maintenance strategy for Dynamics 365 finance and operations data (part one)

In this two-part series, you'll learn how to create an effective data maintenance strategy for your Dynamics 365 finance and operations data. ...

28 days ago

Performance testing using JMeter in D365 Finance and operations.

To use JMeter for load testing Dynamics 365 Finance, you’ll want to set up your test plan to simulate the expected user behavior and loa...

1 month ago

Introduction to Copilot in Microsoft Dynamics 365 Finance and Operations: DCAI002

Amidst the buzz and discussions surrounding Copilot and AI capabilities, I felt compelled to delve into their functionalities specifically fro...

2 months ago

Customer and vendor balances netting for Dynamics 365 Finance and operations.

Netting customer and vendor balances in Dynamics 365 Finance and Operations (D365 F&O) involves consolidating the amounts owed to and from...

2 months ago

Inventory value report in Microsoft Dynamics 365 Finance and Operations: Part-9

Welcome to the next part in the Inventory Valuation Series within Microsoft Dynamics 365 Finance and Operations. After exploring multiple valu...

2 months ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy