Bugfix
Detail
#28413
Newly created persons cannot be assigned to groups in the same transaction
The deputy group is only created in the commit. Therefore, a newly created person cannot be assigned directly to a group because this assignment would also have to assign the deputy group to the group.
"Solution"
The person initializer, which is responsible for creating the deputy group, must check whether the newly created person has already been assigned to a group and, if so, then also assign the created deputy group to this group.
Test
Create a new account in the script console and assign it directly to a group:
all(`tl.accounts:Group`) .filter(g -> $g.get(`tl.accounts:Group#name`) == "securityOwner") .add(`tl.accounts:Group#members`, new(`tl.accounts:Person`) ..set(`tl.accounts:Person#name`, "foobar") ..set(`tl.accounts:Person#contact`, new(`Contacts:PersonContact`) ..set(`Contacts:PersonContact#name`, "FooBar") ) )
Then check in the instance editor whether the deputy group of the new account has also been assigned to the group.