using System;

    using Microsoft.Xrm.Sdk;

    using Microsoft.Crm.Sdk.Messages;

    using Microsoft.Xrm.Sdk.Query;

/// <summary>

    /// 知识库文章

    /// </summary>

    public class KbArticleHelper

    {

        public static readonly string entityName = "kbarticle";

        public Guid kbArticleId = Guid.Empty;

        public IOrganizationService service;

/// <summary>

        /// 创建知识库文章

        /// </summary>

        public void Create()

        {

            Entity en = new Entity() { LogicalName = entityName };

            en["title"] = "知识库文章測试";

            kbArticleId = service.Create(en);

        }

/// <summary>

        /// 检索指定的产品的前十篇知识库文章

        /// </summary>

        /// <param name="productId">产品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>

        /// 检索指定的主题的前十篇知识库文章

        /// </summary>

        /// <param name="subjectId">主题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>

        /// 查找正文中包括指定文本的全部文档索引

        /// </summary>

        /// <param name="query">查询条件</param>

        /// <param name="text">指定文本</param>

        /// <param name="subjectId">主题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>

        /// 查找包括指定keyword的全部文档索引

        /// </summary>

        /// <param name="query">查询条件</param>

        /// <param name="text">指定文本</param>

        /// <param name="subjectId">主题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>

        /// 查找标题中包括指定文本的全部文档索引

        /// </summary>

        /// <param name="query">查询条件</param>

        /// <param name="text">指定文本</param>

        /// <param name="subjectId">主题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>

        /// 删除知识库文章

        /// </summary>

        public void Delete()

        {

            service.Delete(entityName, kbArticleId);

        }

    }

crm操作知识库文章实体的更多相关文章

  1. crm操作销售订单实体

    using System;     using Microsoft.Xrm.Sdk;     using Microsoft.Xrm.Sdk.Query;     using Microsoft.Cr ...

  2. 无法安装 VMware Tools。尝试访问安装 VMware Tools 所需的图像文件“/usr/lib/vmware/isoimages/linuxPreGlibc25.iso”时出错: 2 (No such file or directory)。请参考产品文档或知识库文章 2129825,了解关于如何获取该客户机操作系统的 VMware Tools 软件包的详细信息。

    无法安装 VMware Tools.尝试访问安装 VMware Tools 所需的图像文件"/usr/lib/vmware/isoimages/linuxPreGlibc25.iso&quo ...

  3. crm操作报价单实体

    using System;     using Microsoft.Xrm.Sdk;     using Microsoft.Crm.Sdk.Messages;     using Microsoft ...

  4. crm操作货币实体

    using System;     using Microsoft.Xrm.Sdk;     using Microsoft.Crm.Sdk.Messages; /// <summary> ...

  5. crm操作产品实体

    using System;     using Microsoft.Xrm.Sdk;     using Microsoft.Crm.Sdk.Messages; /// <summary> ...

  6. crm操作约会实体

    using System;     using Microsoft.Xrm.Sdk;     using Microsoft.Crm.Sdk.Messages;     using Microsoft ...

  7. crm操作发票实体

    using System;     using Microsoft.Xrm.Sdk;     using Microsoft.Xrm.Sdk.Query;     using Microsoft.Cr ...

  8. Microsoft Dynamics CRM 2013 --针对特定实体,取消保存功能(包含自动保存)

    AutoSave 是 Microsoft Dynamics CRM 2013 一个新特性. 但AutoSave的有效范围是[所有实体],不允许针对特定某一实体进行设置. 所以,若想针对特定实体进行设置 ...

  9. C# 串口操作 ---- 系列文章

    C# 串口操作系列(5)--通讯库雏形 通讯库雏形的建立. 串口通讯介绍的高级篇,介绍更高级的抽象,为扩展为通用的客户端通讯库做铺垫,扩展性的考虑,能支持任意类型的流设备. ... 2010-08-0 ...

随机推荐

  1. PHP性能优化学习笔记--语言级性能优化--来自慕课网Pangee http://www.imooc.com/learn/205

    使用ab进行压力测试 ab -n行数 -c并发数 url 重点关注下面两点: 1.Request per secend : 每秒可接收的请求数 2.Time per request : 每次请求所耗费 ...

  2. Java实现将指定目录内的指定类型的文件归类

    这两天在学Java IO流,正好让我产生了将自己的电子书归类的打算,说做就做,Why not?看着自己所学所用能解决生活中的实际问题,是不是非常有成就感,那是必须的! package DepthSea ...

  3. What is NetApp's Cluster File System?

    Data ONTAP GX: A Scalable Storage Cluster www.usenix.org/event/fast07/tech/full_papers/eisler/eisler ...

  4. 微信小程序demo豆瓣图书

    最近微信小程序被炒得很火热,本人也抱着试一试的态度下载了微信web开发者工具,开发工具比较简洁,功能相对比较少,个性化设置也没有.了解完开发工具之后,顺便看了一下小程序的官方开发文档,大概了解了小程序 ...

  5. Android向Rest服务Post数据遇到的Date类型数据问题

    今天在Android端向Rest服务Post数据时,总是不成功,查了很多资料,才知道Rest端将json串反序列化时,需要的时间格式必须是UTC类型,及Date(12345678+0800)格式. A ...

  6. BaceModel

    https://github.com/nicklockwood/BaseModel 字典封装成model 自动封装 要求属性的名字与字典一样 不能有对象 如果其中有需要自己封装的对象属性 重写setW ...

  7. 自定义tableviewCell的分割线

    第一种:addsubview UIView *line = [[UIView alloc]initWithFrame:CGRectMake(10, cellH-0.5, DEVW-10, 0.5)]; ...

  8. add monitor resolution

    cvt 1920 1080 # Get the correct settings for the new mode # Output for me: "1920x1080_60.00&quo ...

  9. [Netty 1] 初识Netty

    1. 简介 最早接触netty是在阅读Zookeeper源码的时候,后来看到Storm的消息传输层也由ZMQ转为Netty,所以决心好好来研究和学习一下netty这个框架. Netty项目地址:htt ...

  10. 【转】生产环境MySQL Server核心参数的配置

         ⑴ lower_case_table_names              ● 推荐理由                    GNU/Linux 平台,对数据库.表.存储过程等对象名称大小 ...