Export (0) Print
Expand All
Expand Minimize

SearchByBodyKbArticle Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online and offline

Searches for knowledge base articles that contain the specified body text.

The relevant classes are specified in the following table.

TypeClass
RequestSearchByBodyKbArticleRequest
ResponseSearchByBodyKbArticleResponse
Entitykbarticle

Remarks

To use this message, pass an instance of the SearchByBodyKbArticleRequest class as the request parameter in the Execute method.

For a list of required privileges, see SearchByBodyKbArticle Privileges.

Example

The following code example shows how to use the SearchByBodyKbArticle message.

[C#]
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the Column Set.
ColumnSet articleColumns = new ColumnSet();
articleColumns.Attributes = new string[] { "articlexml" };

// Create the request.
SearchByBodyKbArticleRequest searchByBodyRequest = new SearchByBodyKbArticleRequest();
// NOTE: Subject ID is not required.
searchByBodyRequest.SubjectId = new Guid("183804f8-3c78-4c2d-a53d-f56b49b71820");
searchByBodyRequest.ReturnDynamicEntities = false;
searchByBodyRequest.ColumnSet = articleColumns;
searchByBodyRequest.SearchText = "sample";

// Execute the request.
SearchByBodyKbArticleResponse searchByBodyResponse = (SearchByBodyKbArticleResponse)service.Execute(searchByBodyRequest);

[Visual Basic .NET]
' Set up the CRM Service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle";
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

// Create the Column Set.
Dim articleColumns As New ColumnSet()
articleColumns.Attributes = New String() {"articlexml"}

' Create the request.
Dim searchByBodyRequest As New SearchByBodyKbArticleRequest()
' NOTE: Subject ID is not required.
searchByBodyRequest.SubjectId = new Guid("183804f8-3c78-4c2d-a53d-f56b49b71820");
searchByBodyRequest.ReturnDynamicEntities = False
searchByBodyRequest.ColumnSet = articleColumns
searchByBodyRequest.SearchText = "sample"

' Execute the request.
Dim searchByBodyResponse As SearchByBodyKbArticleResponse = _
CType(service.Execute(searchByBodyRequest), SearchByBodyKbArticleResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft