CRM Operations Knowledge Base article entity

Source: Internet
Author: User
Tags knowledge base

Using System;
Using MICROSOFT.XRM.SDK;
Using Microsoft.Crm.Sdk.Messages;
Using Microsoft.Xrm.Sdk.Query;

<summary>
Knowledge Base Articles
</summary>
public class Kbarticlehelper
{
public static readonly String entityname = "Kbarticle";
Public Guid Kbarticleid = Guid.Empty;
public Iorganizationservice Service;

<summary>
Create a Knowledge Base article
</summary>
public void Create ()
{
Entity en = new entity () {logicalname = entityname};
en["title" = "Knowledge Base article test";
Kbarticleid = service. Create (en);
}

<summary>
Retrieves the first 10 KB articles for a specified product
</summary>
<param name= "ProductId" > Product id</param>
public void Retrievebytopincidentproductkbarticle (Guid productId)
{
Retrievebytopincidentproductkbarticlerequest request = new Retrievebytopincidentproductkbarticlerequest ();
Request. ProductId = ProductId;
Retrievebytopincidentproductkbarticleresponse response =
(retrievebytopincidentproductkbarticleresponse) service. Execute (Request);
Entitycollection entitycollection = Response. Entitycollection;
}

<summary>
Retrieves the first 10 knowledge Base articles for a specified topic
</summary>
<param name= "Subjectid" > Theme id</param>
public void Retrievebytopincidentsubjectkbarticle (Guid subjectid)
{
Retrievebytopincidentsubjectkbarticlerequest request = new Retrievebytopincidentsubjectkbarticlerequest ();
Request. Subjectid = Subjectid;
Retrievebytopincidentsubjectkbarticleresponse response =
(retrievebytopincidentsubjectkbarticleresponse) service. Execute (Request);
Entitycollection entitycollection = Response. Entitycollection;
}

<summary>
Finds all document indexes in the body that include the specified text
</summary>
<param name= "Query" > Query criteria </param>
<param name= "Text" > Specify text </param>
<param name= "Subjectid" > Theme id</param>
public void Searchbybodykbarticle (querybase query,string text,guid Subjectid)
{
Searchbybodykbarticlerequest request = new Searchbybodykbarticlerequest ();
Request. queryexpression = query;
Request. Useinflection = true;
Request. SearchText = text;
Request. Subjectid = Subjectid;
Searchbybodykbarticleresponse response = (searchbybodykbarticleresponse) service. Execute (Request);
Entitycollection entitycollection = Response. Entitycollection;
}

<summary>
Finds all document indexes that include the specified keyword
</summary>
<param name= "Query" > Query criteria </param>
<param name= "Text" > Specify text </param>
<param name= "Subjectid" > Theme id</param>
public void Searchbykeywordskbarticle (querybase query, string text, Guid Subjectid)
{
Searchbykeywordskbarticlerequest request = new Searchbykeywordskbarticlerequest ();
Request. queryexpression = query;
Request. Useinflection = true;
Request. SearchText = text;
Request. Subjectid = Subjectid;
Searchbykeywordskbarticleresponse response = (searchbykeywordskbarticleresponse) service. Execute (Request);
Entitycollection entitycollection = Response. Entitycollection;
}

<summary>
Find all document indexes that include the specified text in the header
</summary>
<param name= "Query" > Query criteria </param>
<param name= "Text" > Specify text </param>
<param name= "Subjectid" > Theme id</param>
public void Searchbytitlekbarticle (querybase query, string text, Guid Subjectid)
{
Searchbytitlekbarticlerequest request = new Searchbytitlekbarticlerequest ();
Request. queryexpression = query;
Request. Useinflection = true;
Request. SearchText = text;
Request. Subjectid = Subjectid;
Searchbytitlekbarticleresponse response = (searchbytitlekbarticleresponse) service. Execute (Request);
Entitycollection entitycollection = Response. Entitycollection;
}

<summary>
Delete a knowledge Base article
</summary>
public void Delete ()
{
Service. Delete (EntityName, Kbarticleid);
}
}

CRM Operations Knowledge Base article entity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.