You may have a need to find out about Teams used in Sage CRM through the webservices.
In the database Teams are defined in a table called Channel
e.g.
select * from Channel;
The Team (channel) is then referenced in the system entities like opportunity and cases.
e.g.
- Opportunity - oppo_channelid
- Cases - Case_channelid
And the user is linked to a team too
- users - user_primarychannelid
The table Channel is not exposed to webservices by default.
See the documentation to learn how to expose a table in webservices (https://www.sagecrm.com/adminhelp/Default_CSH.htm#Administrator/EA_ChangingExternalAccess.htm)
If you expose the table you could then access the teams by using the standard webservice methods. This example is in C#
queryrecordresult myQueryRecordTeamsResult;
myQueryRecordTeamsResult = CRMbinding.queryrecord("chan_channelid, chan_description", "chan_deleted is null", "channel", "chan_channelid");
crmrecord[] myRecordList = myQueryRecordTeamsResult.records;
for (int intCount = 0; intCount < myRecordList.Length; intCount++)
{
recordfield[] myFieldList = myRecordList[intCount].records;
for (int intCount2 = 0; intCount2 < myFieldList.Length; intCount2++)
{
recordfield myField = (recordfield)myFieldList[intCount2];
//do something with the channel info
listBoxCompanyNames.Items.Add(myField.name + ": =" + myField.value);
}
}
BUT exposing the channel table is only possible if you have access to the server and you can change the settings. If you are interacting with an install of Sage CRM where you can not expose the Channel table to webservices then you will need to use a different technique.
The Team (channel) data is used in the tables like user, cases, and opportunities. So in these circumstances you can use the details in the user table to create a list of the primary key values of the different Teams used in the system by looking how they are used in the foreign keys of the user table. (user_primarychannelid)
This makes the assumption that no work (communication, case, opportunity) would be assigned to a team unless it was also assigned to a user and all users would be in a team.
queryrecordresult myQueryRecordTeamsResult = CRMbinding.queryrecord("user_userid, user_primarychannelid", "User_IsTemplate = 'N'", "users", "user_primarychannelid");
crmrecord[] myRecordList = myQueryRecordTeamsResult.records;
for (int intCount = 0; intCount < myRecordList.Length; intCount++)
{
recordfield[] myFieldList = myRecordList[intCount].records;
for (int intCount2 = 0; intCount2 < myFieldList.Length; intCount2++)
{
recordfield myField = (recordfield)myFieldList[intCount2];
//start processing the list to derive the distinct values of the Teams
//myField.name + ": =" + myField.value;
}
}