Marked Records |
In AX, we often face a situation where we need to get the reference of those records which are marked on grid control. Using below code you can get those marked records in X++. Records marked can be seen in screenshot on the left.
Array markedRecords = gridControl_DS.recordsMarked();
var lastMarkedRecord = markedRecords.lastIndex();
You will get a recId of last marked record in lastMarkedRecord. Using recordMarked() method of grid control data source, you can get an array of marked records which can be used for further iteration based on requirement.
Selected Records |
for (inv = gridControl_ds.getFirst(true) ? gridControl_ds.getFirst(true) : gridControl_ds.cursor(); inv; inv = gridControl_ds.getnext())
{
//logic here
}
gridControl_ds.getFirst(true) will give first selected record and getnext() will give next selected record.
thanks
p.
Comments
Post a Comment