How to Find out about Teams (xxx_channelid) in Webservices

Less than one minute read time.

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 ">

queryrecordresult myQueryRecordTeamsResult = CRMbinding.queryrecord("user_userid, user_primarychannelid", "User_IsTemplate = 'N'", "users", "user_primarychannelid");
crmrecord[] myRecordList = myQueryRecordTeamsResult.records;
for (int intCount = 0; intCount ">