Share via


BizTeam.Retrieve Method

The Retrieve method retrieves team information.

Syntax

[Visual Basic .NET]
Public Function Retrieve(
  ByVal Caller As CUserAuth,
  ByVal TeamId As String,
  ByVal ColumnSetXml As String
) As String
[C#]
public string Retrieve(
  CUserAuth  Caller,
  string  TeamId,
  string  ColumnSetXml
);
[C++]
public: String* Retrieve(
  CUserAuth*  Caller,
  String*  TeamId,
  String*  ColumnSetXml
);

Parameters

Caller

Specifies the identity of the caller. The caller must have the prvReadTeam privilege to perform this action. See CUserAuth.

TeamId

Specifies the ID of the team to retrieve.

ColumnSetXML

Specifies an XML string describing the fields you would like returned for each member. Passing "" or null returns all columns. The XML schema is described by systemusers.xsd. See also ColumnSetXML Schema.

Return Value

Returns a String type that specifies the XML data containing the team information. The fields that are returned depend on what fields are specified in the ColumnSetXML parameter. The XML schema is described by team.xsd.

Remarks

If there is an error, SOAP throws an exception and the error message is reported in System.Web.Services.Protocols.SoapException.Detail.OuterXml.

All IDs passed to the platform are GUIDs wrapped in braces. For example: {6522D89A-A752-4455-A2B0-51494C6957C3}

Example

[C#]
// strServer should be set with the name of the platform Web server
string strServer = "myservername";

// strVirtualDirectory should be set with the name of the Microsoft CRM 
// virtual directory on the platform Web server
string strVirtualDirectory = "mscrmservices";

// Create the URL to the SRF files for platform objects
string strDir = "https://" + strServer + "/" + strVirtualDirectory + "/";

// BizUser proxy object
Microsoft.CRM.Proxy.BizUser user = new Microsoft.CRM.Proxy.BizUser ();
user.Credentials = System.Net.CredentialCache.DefaultCredentials;
user.Url = strDir + "BizUser.srf";

// BizTeam proxy object
Microsoft.CRM.Proxy.BizTeam team = new Microsoft.CRM.Proxy.BizTeam ();
team.Credentials = System.Net.CredentialCache.DefaultCredentials;
team.Url = strDir + "BizTeam.srf";

// Declare the caller
Microsoft.CRM.Proxy.CUserAuth userAuth = null;

string strErrorMsg;
string strTeamID = "{GCF99EF1-67IO-4E06-ABD9-EBFE526BF9FF}";
try
{
   // Get the UserAuth of the current logged-on user
   userAuth = user.WhoAmI();

   // Set up the columns that you want to retrieve
   string strColumnSetXml = "<columnset>";
   strColumnSetXml += "<column>name</column>";
   strColumnSetXml += "<column>teamid</column>";
   strColumnSetXml += "<column>emailaddress</column>";
   strColumnSetXml += "</columnset>";
   
   string strTeamXml = team.Retrieve(userAuth, strTeamID, strColumnSetXml);
}
catch(System.Web.Services.Protocols.SoapException err)
{
   // Process the platform error here
   strErrorMsg = ("ErrorMessage: " + err.Message + " " + err.Detail.OuterXml + " Source: " + err.Source );
}
catch(Exception err)
{
   // Process other errors here
   strErrorMsg = ("ErrorMessage: " + err.Message + "Source: " + err.Source );
}

Requirements

Namespace: Microsoft.CRM.Proxy

Assembly: microsoft.crm.proxy.dll

See Also

© 2003 Microsoft Corporation. All rights reserved.