The script is in a custom command.
I have a business rule triggering before creating a group, which executes the custom command, with scope on all objects
Every team has a number set in the attribute gidNumber
This number has to be unique, no other team should have the same number.
In case a new team (group) is created, the gidNumber of all existing teams must be checked. If the gidNumber of the new team already exists on another team, there should be an error.
Now, the business rule triggers, the script is executed and gives me no error. I can create a team with an existing gidNumber, without an error.