Newer Version Available
KnowledgeArticleVersion
- Query or search generically across multiple article types.
- Filter on a specific version.
- Update standard fields, those fields that are updateable, in draft versions.
Supported Calls
create(), delete(), describeLayout(), describeSObjects(), query(), retrieve(), search(), and update().
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
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
1SELECT Title, Summary
2FROM KnowledgeArticleVersion
3WHERE PublishStatus='Online'
4AND Language = 'en_US'
5WITH DATA CATEGORY Geography__c ABOVE_OR_BELOW europe__c AND Product__c BELOW All__c1SELECT Id, Title
2FROM Offer__kav
3WHERE PublishStatus='Draft'
4AND Language = 'en_US'
5WITH DATA CATEGORY Geography__c AT (france__c,usa__c) AND Product__c ABOVE dsl__c1SELECT Id
2FROM KnowledgeArticleVersion
3WHERE PublishStatus='Archived'
4AND IsLatestVersion=false
5AND KnowledgeArticleId='kA1D00000001PQ6KAM'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.
Additional Usage for SOQL and SOSL with KnowledgeArticleVersion
- To expose the migrated_to_from_id on KnowledgeArticle and
KnowledgeArticleVersion to the sObject API: expose MigratedToFromArticleVersion
in KnowledgeArticleVersion. The org must have pref LightningKnowledgeEnabled. For
SOQL:
- To filter by MigratedToFromArticleVersion, remove any other filters.
- When filtering by MigratedToFromArticleVersion, use the '=' or 'IN' operator.
- When filtering by MigratedToFromArticleVersion, the value can't be null or empty.
- For SOSL
-
- MigratedToFromArticleVersion isn't supported in SOSL.