web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Calling Menu item with Args in D365 Finance and Operations X++

Rahul Kiran Profile Picture Rahul Kiran 481
Below is the example I created for demonstrating how to call a menu item from X++. In this example I'm calling sales packing slip menu item for posting sales packing slip for all lines.


class SW_TestClassDebug
{       
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        MenuFunction    menuFunction;
        salestable _SalesTable = SalesTable::find("SO00125111");
        Args            args = new Args();

        args.record(_SalesTable);

        menuFunction = new MenuFunction(menuitemActionStr(SalesFormLetter_PackingSlip), MenuItemType::Action);

        if (menuFunction && menuFunction.checkAccessRights())
        {

            menuFunction.run(args);
        }
    }

}

This was originally posted here.

Comments

*This post is locked for comments