firstInstance
firstInstance(): InstanceType;
The firstInstance method of the Class class returns a reference to the first instance of the class. (See also "Caveat When Handling Persistent Class Instances", earlier in this section.)
The following examples show the use of the firstInstance method.
deleteAllInvestors() updating; vars object : Object; begin beginTransaction; app.setMarket(Market.firstInstance); foreach object in app.myMarket.allInvestors do delete object; endforeach; commitTransaction; end;
// Check for first company setup app.myCompany := Company.firstInstance; if app.myCompany = null then beginTransaction; create coy; app.myCompany := coy; commitTransaction; endif;