Thursday, July 8, 2010

fetch selected data from grid

When you are on form and want to select the selected data from the grid, You can get from the table datasource from the form by using ****_ds.getFirst(true). It will provide the reference of the respective table buffer.
for example if i select some rows from the CustTable form and I want to show it in an infolog.

Use the following Code.

CustTable custTable1;


super();

for (custTable1 = custTable_ds.getFirst(true); custTable1; custTable1 = custTable_ds.getNext())
{
info(strfmt('%1', custTable1.AccountNum));
}



If you will not provide true in custTable_ds.getFirst(), it will fetch all the records.

so to fetch all records from the grid.

change the for loop line.

for (custTable1 = custTable_ds.getFirst(true); custTable1; custTable1 = custTable_ds.getNext())

No comments:

Post a Comment