These are simple code snippets to loop through a record from a data source.
Using a while loop
salesLine_ds = _salesLine.dataSource();
localSalesLine = salesLine_ds.getFirst(true) as SalesLine;
if (localSalesLine)
{
while (localSalesLine)
{
//Do your thing
localSalesLine = salesLine_ds.getNext() as SalesLine;
}
}
|
Using a for loop
salesLine_ds = _salesLine.dataSource();
for (localSalesLine = salesLine_ds.getFirst(true) ? salesLine_ds.getFirst(true) : salesLine_ds.cursor();
localSalesLine;
localSalesLine = salesLine_ds.getNext())
{
//Do your thing
} |
Using MultiSelectionHelper class (blogged previously)
Using MultiSelectionHelper class (blogged previously)
Using MultiSelectionHelper class (blogged previously)