AnsweredAssumed Answered

Getting the primary team id and storing it in a field

Question asked by Jake Vernon on Jan 5, 2017
Latest reply on Jan 10, 2017 by ahvaghasia

I am trying to get the primary team id from an opportunity record and store it in a custom field.  My current thought process is:

 

// instead of the above I would do something like this, as an example
$bean = new Opportunity();
$bean->retrieve($record_id);
//Load the team relationship
$bean->load_relationship('teams');
//Set the primary team
$bean->opp_team_id_c = $bean->retrieve($team_id_1);
//Save to update primary team
$bean->save();

 

I'm adding this in modules/Opportunities/clients/base/record.php

 

Any and all feedback would help!

Outcomes