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;        &...

1 month 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...

1 month 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.

1 month 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...

2 months 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...

2 months 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...

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