Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Saturday, October 25, 2014

Code to get multi selected records in from grid in AX

Hi,

Make that object (button) to multiselect property as "YES".
on the control (button) event method (Clicked).

void clicked()
{

     int             ListOfRecIds, i=1;
    container  contains;
    CustTable  custTableLoc; // Table_Name  that we used in as the datasource.
    super();
   
    ListOfRecIds= custTable_ds.recordsMarked().lastIndex();
    custTableLoc= custTable_ds.getFirst(1);
   
   while (custTableLoc)
    {
        contains = conIns(container, i ,custTableLoc.AccountNum)
       custTableLoc = custTable_ds.getNext();
        i++;
    }
 }
Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...