There is a verry simple trick to loop through some companies and execute some code in them.
Just write:
DataArea dataArea; ; while select dataArea where !dataArea.isVirtual { changecompany(dataArea.id) { // Do Something... } } |
Note! Make sure that you clear the table variable after each companychange (common = null;).