how to show selected form grid records in info method in X++

 override the clicked method and paste the following code inside the method



MultiSelectionHelper          selectionHelper = MultiSelectionHelper::construct();//Create instance of class

            Set                           selectedRecords = new Set(Types::Record);//Declare a set of type record

            Employee                  tableLines; //Your table buffer

            super();

 

            selectionHelper.parmDataSource(Employee_ds); //Set the datasource

            tableLines  = selectionHelper.getFirst(); //assign to table buffer the reference to selected record(s)

 

            if (tableLines.RecId)

            {

                while (tableLines)

                {

                    selectedRecords.add(tableLines);

                    info(strFmt('Selected record.. %1',tableLines.EmpID));//Display selected record

                    tableLines = selectionHelper.getNext();

                }

            }


Comments

Popular posts from this blog

How to Create a wizard in x++ d365

how to post trade agreement journals automatically using x++ code

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O