Newer Version Available

This content describes an older version of this product. View Latest

KnowledgeArticleVersion

Provides a global view of standard article fields across all article types depending on their version. This object is available in API version 18.0 and later.
Use this object to:
  • Query or search generically across multiple article types.
  • Filter on a specific version.
  • Update standard fields, those fields that are updateable, in draft versions.
When you query on the archived article, the results include both the article and the article’s archived versions.

You can’t update draft translations with the API.

Note

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), query(), retrieve(), search(), and update().

  • You can only update draft versions.
  • To create, update, or delete a Knowledge article version, use the call on ArticleType_kav, where ArticleType is the name of the article’s type. For example, to delete, use ArticleType_kav.delete().

Note

Special Access Rules

A user must have the “View Articles” permission enabled. Salesforce Knowledge users, unlike Customer Portal and partner portal users, must also be granted the Knowledge User feature license to view and edit article versions.

Fields

Field Name Details
ArchivedById
Type
reference
Properties
Filter, Nillable
Description
The ID of the user who archived the article.
ArchivedDate
Type
dateTime
Properties
Filter, Nillable
Description
The date when the article was archived.
ArticleNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter
Description
The unique number automatically assigned to the article when it's created. You can't change the format or value for this field.
ArticleType
Type
string
Properties
Defaulted on create,Filter
Description
Indicates the API Name of the article type. The ArticleType is assigned to the article when it's created. You can't change the value of this field. This field is available in API version 26.0 and later.
FirstPublishedDate
Type
dateTime
Properties
Filter, Nillable
Description
The date when the article was first published.
IsLatestVersion
Type
boolean
Properties
Defaulted on create, Group, Filter, Sort
Description
Indicates whether the article is the most current version. (true) or not (false). This field can be true on the online or published version, a draft version in the master language, a draft version in a translation, and the latest archived version. However, you can’t filter by (PublishState=’Online’) and (IsLatestVersion=false) because the online version is also the latest version. This field is available in API version 24.0 and later.
IsMasterLanguage
Type
boolean
Properties
Defaulted on create, Filter
Description
Indicates whether the article has one or more translations associated with it (true) or not (false). Only accessible if your knowledge base supports multiple languages.
IsOutOfDate
Type
boolean
Properties
Defaulted on create, Filter
Description
Indicates whether the source article has been updated since this translated version was created (true) or not (false). Only accessible if your knowledge base supports multiple languages.
IsVisibleInApp
Type
boolean
Properties
Defaulted on create, Filter
Description
Required. Indicates whether the article is visible in the Articles tab (true) or not (false).
IsVisibleInCsp
Type
boolean
Properties
Defaulted on create, Filter
Description
Required. Indicates whether the article is visible in the Customer Portal (true) or not (false).
IsVisibleInPkb
Type
boolean
Properties
Defaulted on create, Filter
Description
Required. Indicates whether the article is visible in the public knowledge base (true) or not (false).
IsVisibleInPrm
Type
boolean
Properties
Defaulted on create, Filter
Description
Required. Indicates whether the article is visible in the partner portal (true) or not (false).
KnowledgeArticleId
Type
reference
Properties
Filter
Description
The ID of the article independent from its version. The value for this field is retrieved from the Id field of the KnowledgeArticle object.
Language
Type
picklist
Properties
Filter, Restricted picklist
Description
The language that the article is written in, such as French or Chinese (Traditional).

Querying or searching articles in SOQL or SOSL requires that you specify the Language field in the WHERE clause. The language must be the same for all article types.

LastPublishedDate
Type
dateTime
Properties
Filter, Nillable
Description
The date when the article was last published.
MasterVersionId
Type
reference
Properties
Filter, Nillable
Description
ID of the source article, if the article is the translation of a source article. Only accessible if your knowledge base supports multiple languages.
OwnerId
Type
reference
Properties
Filter
Description
The ID of the article's owner.
PublishStatus
Type
picklist
Properties
Defaulted on create, Filter, Restricted picklist
Description
The publication status for the article:
  • Draft: any draft articles.
  • Online: articles published in Salesforce Knowledge.
  • Archived: archived articles.

A user must have the “Manage Articles” permission enabled to use Online.

Querying or searching articles in SOQL or SOSL requires that you specify either the PublishStatus or the Id field in the WHERE clause. You can search for only one publication status per article type in a single SOSL query. When searching for articles with a PublishStatus of Archived, also check that IsLatestVersion equals false in your WHERE clause.

SourceId
Type
reference
Properties
Filter, Nillable
Description
ID of the source from which the article was created (Case or Reply).
Summary
Type
textarea
Properties
Filter, Nillable
Description
Summary of the article. Maximum size is 1000 characters.
Title
Type
string
Properties
Defaulted on create, Filter, idLookup
Description
Required. Article's title. Maximum size is 255 characters.
TranslationCompletedDate
Type
dateTime
Properties
Filter, Nillable
Description
Date and time when the article was last translated. Only accessible if your knowledge base supports multiple languages.
TranslationExportedDate
Type
dateTime
Properties
Filter, Nillable
Description
Date and time when the article was last exported for translation. Only accessible if your knowledge base supports multiple languages.
TranslationImportedDate
Type
dateTime
Properties
Filter, Nillable
Description
Date and time when the article was last imported for translation. Only accessible if your knowledge base supports multiple languages.
UrlName
Type
string
Properties
Filter
Description
Required. Represents the article's URL. Can contain alphanumeric characters and hyphens but can't begin or end with a hyphen. UrlName is case-sensitive and its maximum size is 255 characters.
ValidationStatus
Type
picklist
Properties
Filter, Group
Description

Shows whether the content of the article has been validated. Default values are Validated and Not Validated. This field is available in API version 24.0 or later.

VersionNumber
Type
int
Properties
None
Description
The number assigned to a version of an article. This field is available in API version 24.0 and later.

Usage

Use this object to query, retrieve, or search for articles across all article types depending on their version. You can update draft master articles. Additionally, you can delete articles that are not drafts. Client applications can use KnowledgeArticleVersion with describeDataCategoryGroups() and describeDataCategoryGroupStructures() to return the category groups and the category structure associated with Salesforce Knowledge.

Alternatively, client applications can use the article type API Name followed by __kav to query, retrieve, or search for articles for a specific article type.

To access an article independent of its version, use the KnowledgeArticle object.

SOQL Samples

The following SOQL clause uses KnowledgeArticleVersion to query all published articles from all article types complying with the classification specified in the WITH DATA CATEGORY clause:
The following SOQL clause uses the article type API Name to limit the query to all draft articles from the Offer__kav article type:
The following SOQL clause uses KnowledgeArticleVersion to query the Ids of all archived versions of a particular article:

SOQL and SOSL with KnowledgeArticleVersion

  • Always filter on a single value of PublishStatus unless the query filters on one or more primary key IDs. To support security, only users with the “Manage Articles” permission see articles whose PublishStatus value is Draft.
  • Archived article versions are stored in the articletype_kav object. To query archived article versions, specify the article Id and set IsLatestVersion='0'.
  • Always filter on a single value of Language. However, in SOQL, you can filter on more than one Language if there is a filter on Id or KnowledgeArticleId.