SugarCRM: Get members of a team

This post will teach you how to fetch all members of a specific team in sugar. You can do this by using the get_team_members function. Look at the example below:

// include Team class
include_once('modules/Teams/Team.php');

$team = new Team();
$team->retrieve('<ID OF THE TEAM>');
$team_members = $team->get_team_members(true);

// Loop through the list
foreach($team_members as $user) {
     // your code here ....
}
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s