0

Suppose that we have a team named 'Team A' having an id 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' and we want to get all the records where this team have been related for example all related Accounts, Leads, Contacts etc

There is also a possibility that a related record have a teamset where 'Team A' is a member of the teamset, can we somehow get even this related record ?

Sheikh Rahat Ali
  • 1,293
  • 8
  • 37
  • 61

1 Answers1

1

My approach would be:

  • Get all Teamsets for the team and store their IDs in an Array, eg. $teamsetIDs
  • Loop over the global $moduleList but, skipping modules that do not use the team_security template
  • For all non-skipped modules, construct SugarQuery, populating its ->where() with ->in('team_set', $teamsetIDs). Then execute it to retrieve the desired record IDs. (If you don't want to also limit the results to the user's visibility, dont forget to specify 'team_security' => false in the SugarQuery options)
Jay
  • 3,640
  • 12
  • 17