Get AOT Menu Item propeties in d365 fo x++

  public static DSSDisplayReportTmp getReports()

    {

        

        Table tableBuf;


        delete_from tableBuf;

        

        System.Type axMenuItemTypeDisplay = new Microsoft.Dynamics.AX.Metadata.MetaModel.AxMenuItemDisplay ().GetType ();

        System.Collections.Specialized.StringEnumerator menuItemDisplayNames = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::MenuItemDisplayNames ();


        while (menuItemDisplayNames.moveNext ())

        {

            str menuItemName = menuItemDisplayNames.get_current ();

            var enum = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetModelsOfMetadataArtifact (menuItemName, axMenuItemTypeDisplay).GetEnumerator ();

            str modelName = enum.moveNext () ? enum.Current.DisplayName : '';


            MenuFunction menuFunction = new MenuFunction (menuItemName, MenuItemType::Output);


            tableBuf.MenuItemName   =   menuItemName;

            tableBuf.MenuItemLabel  =   menuFunction.label();

            tableBuf.Design            =  menuFunction.objectType(4) ? menuFunction.reportDesign() : "";

            tableBuf.insert();

        }

        return tableBuf;

    }

Comments

Popular posts from this blog

Get Current Worker data in d365 fo x++

Table Level Event Handler in d365 fo x++