identify multiple selected records
Next create a button on form . and call the method on the button click event.
(for the button property makesure the Multiselect should be set to yes , or else by default for multiple selection system will disable the buttons)
wrote by Jimmy on Dec.7th 2010
void clicked()
{
CDSEXRM CDSEXRMLocal;
int i;
;
//1)From currenct cursor record ,util next to 10 records
CDSEXRMLocal = CDSEXRM_ds.cursor();
while (CDSEXRMLocal)
{
//dosomething........
info(strfmt("You selected Item %1",CDSEXRMLocal.ItemId));
i++;
if(i == 10)
break;
next CDSEXRMLocal;
}
//2)
//method 01 using for loop fect to identify multiple selected records in Form
for(CDSEXRMLocal = CDSEXRM_ds.getFirst(1) ? CDSEXRM_ds.getFirst(1) : CDSEXRM_ds.cursor();
CDSEXRMLocal;
CDSEXRMLocal = CDSEXRM_ds.getNext())
{
info(strfmt("You selected Item %1",CDSEXRMLocal.ItemId));
//dosomething........
}
//method 02 using mark flag fect to identify multiple selected records in Form
if(CDSEXRM_ds.mark())
{
CDSEXRMLocal = CDSEXRM_ds.getFirst(1);
while(CDSEXRMLocal)
{
info(strfmt("You selected Item %1",CDSEXRMLocal.ItemId));
//dosomething........
CDSEXRMLocal = CDSEXRM_ds.getNext();
}
}
else
{
CDSEXRMLocal = CDSEXRM_ds.cursor();
//dosomething........
info(strfmt("You selected Item %1",CDSEXRMLocal.ItemId));
}
}

浙公网安备 33010602011771号