AnsweredAssumed Answered

How to set multiple team when create new record via logic hook

Question asked by Autchara Chaiprom on Mar 23, 2017
Latest reply on Mar 23, 2017 by Autchara Chaiprom

Hi,

 

I try to create case record and put multiple teams, one is primary team(fetch from parent) another is team id 

but it doesn't work.

$c = BeanFactory::newBean('Cases');
$c->name = 'Test';
$c->status = 'New';
$c->assigned_user_id = 'xxxxxxxx-bbbb-cccc-yyyy-eeeeeeeeeeee';
$c->team_id = array(
     array(id => $bean->team_id, primary => true),
     array(id => 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee')
);
$c->account_id = $bean->id;
$c->priority = 'P1';
$c->save();

  

It not set primary team after created a record but all team have been added.

 

How do I fix my code?

Please help 

 

Sugar 7.7.1.0

Thanks,

Autchara

Outcomes