Thursday, 15 August 2019

Calling Action Menu item in D365 Finance and Operations X++

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);
        }
    }

}

1 comment:

  1. I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? link

    ReplyDelete

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...