#573 - Assign Records
Hello,
I'm trying to add a functionality to SugarCRM using the Securty Suite. I want to add automatically the teams when i create a case, and for that, this support page was very helpful as i used part of the code that i saw in another post:
$securityTeam = new SecurityGroup();
$securityTeam->retrieve_by_string_fields(array('name' => $field_securityGroup ));
$bean->load_relationship('SecurityGroups');
$bean->SecurityGroups->add($securityTeam->id);
$bean->save();
The problem is that i don't know the name of the team, i just know the id of the user that belongs to the teams i want to add.
I know that i can do this with a query to the securitygroups_users table, but i want to do this without doing queries to provide a better performance.
There are another way i can do this?
Thanks in advance for your help!
Regards,
Joana Lopes da Fonseca
10 years ago
10 years ago