Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Since the calculation counts the objects count whenever a new instance is created, you may reach the limit and get an error about too many instances. To avoid this problem, put "def" outside the loops or closures.

So instead of doing:

Too many instances
for (record in records) {
  def cost = ....
}

Use this approach:

Safer approach
def cost
for (record in records) {
  cost = ....
}
  • No labels