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

D365 Sending Email with Customer Account Statement SSRS report as attachment using X++

D365 Sending Email with Customer Account Statement SSRS report as attachment using X++ custTable _custTable;        &...

2 days ago

clicking link on info message X++ to Open form

 Message::AddAction() method can be used to embed an action within a message sent to the message bar. This method supports adding a singl...

3 days ago

Implement Periodic Data Export from D365FO to SFTP

This blog post describes how to implement various scenarios for periodic data export from D365FO to a file and uploading it to SFTP server.

14 days ago

[New Feature] Financial Consolidation Template in Microsoft Dynamics 365 Finance and Operations

πŸš€ New Feature Online Consolidation Template! πŸš€ This feature streamlines the financial consolidation process and enhances the user experience...

27 days ago

[New Feature] Bank Account Lifecycle Management in Microsoft Dynamics 365 Finance and Operations

πŸš€ New Feature: Workflow approvals for Bank master! πŸš€ Microsoft has recently added a new preview feature in Microsoft Dynamics 365 Finance an...

27 days ago

Business Performance Analytics in Microsoft Dynamics 365 Finance and Operations: Part-2

πŸ“’ Now Time to Business Performance Analytics in Microsoft Dynamics 365! Let’s dive into the various reports available in Business Perfo...

27 days ago

Business Performance Analytics in Microsoft Dynamics 365 Finance and Operations: Part-1

πŸ“’ Now Time to Business Performance Analytics in Microsoft Dynamics 365! While we focus on new developments around Copilot and AI, let’s...

27 days ago

Dual Currency Valuation/Reporting using Global Inventory Accounting in Microsoft Dynamics 365 Finance and Operations: Part-12

πŸ“’ Part-3: Now Time to Explore Global Inventory Accounting in Microsoft Dynamics 365! 🌍 Welcome to the next part of Global inventory accounti...

27 days ago

Configure Reporting for Global Inventory Accounting in Microsoft Dynamics 365 Finance and Operations: Part-11

πŸ“’ Part-2: Now Time to Explore Global Inventory Accounting in Microsoft Dynamics 365! 🌍 In the next part of our Global Inventory Accounting s...

27 days ago

Global Inventory Accounting in Microsoft Dynamics 365 Finance and Operations: Part-10

πŸ“’ Now Time to Explore Global Inventory Accounting in Microsoft Dynamics 365! 🌍 I’m excited to dive into one of the most powerful featu...

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