Dela via


Create, publish and search for an article

 

Applies To: Dynamics CRM 2013

During its lifecycle, an article can be in the following states:

  • Draft (after an article is created)

  • Unapproved (during editing)

  • Published (after an article is published)

To change the state of the article, use the SetStateRequest message. For early bound types, use the KbArticleState enumeration to set the possible states.

Associate an article with a template

When you create an article, you have to associate it with a template and a subject. An article template describes the sections and formatting for the article. Subjects are used to organize the articles by business categories that are also used to group cases (incidents), sales literature, and products. A best practice is to create a subject tree hierarchy and all necessary article templates before you create an article.

Note

Microsoft Dynamics CRM provides several article templates. They include a standard article, a solution to a problem, a procedure, and other templates. The recommended method of creating article templates is by using the Microsoft Dynamics CRM web application. If you want to create an article template programmatically, use existing article templates as examples of what information to include and how to format the data.

To associate an article with a template, use the KbArticle. KbArticleTemplateId attribute. To place an article in a specific category by specifying a subject, use the KbArticle.SubjectId attribute.

Specify the title of the article and the keywords that you want to use in the search. To describe an article you can use the KbArticle.Description attribute. To add the content for the article, use the KbArticle.Content attribute. Use the Kbarticle.ArticleXml attribute to add the XML data for article. The KbArticle.LanguageCode value is obtained from the template to help you write the queries that sort the articles by the language.

When an article is created it is saved as a draft. After that, you can change the state of the article from “Draft” to “Unapproved.” You can modify the content of an unapproved article and make it ready for publishing. When the article is ready to be published, change the state from “Unapproved” to “Published.”

An unpublished article obtains the format settings from a template. If you change a template format, the changes are automatically propagated to articles in the “Draft” and “Unapproved” states.

After you publish an article, you can add comments (KbArticleComment), but you can’t edit it, regardless of your privileges. The comments can be added to the article that is in any of the states.

Note

The comments can be added to the article in any state: Draft, Unapproved or Published.

To revise or update the article, you have to unpublish it. To unpublish an article, change the state of the article from Published to Unapproved. To delete an article from the Microsoft Dynamics CRM database, change the state of the article from Published to Unapproved or Draft.

Note

A knowledge base article cannot be deleted, if it is in the Published state.

For more information on creating, updating, editing, and locating an article in the knowledge base, see Use articles in knowledge base.

See Also

Knowledge base entities
KbArticle (article) entity messages and methods