I am using the knowledge(Knowledge__kav
) object with 4-5 custom fields.
For an article having 5 version. How can i query the archived article version with the custom field using KnowledgeArticleVersion
object.
SELECT Id, Title, Revision_Notes__c, Short_description__c
FROM Knowledge__kav
WHERE Language= 'en_US' And PublishStatus='online'
WITH DATA CATEGORY Knowledge_Base_Category__c BELOW Download__c.
In the above query Revision_Notes__c
and Short_description__c
are the custom fields.
I needs to get those two fields value using KnowledgeArticleVersion object.
The below is the query which i was tried but getting error
SELECT
Id, KnowledgeArticleId, VersionNumber, FirstPublishedDate, LastPublishedDate, ArchivedDate, KnowledgeArticleId.Revision_Notes__c, KnowledgeArticleId.Short_description__c
FROM KnowledgeArticleVersion
WHERE PublishStatus='Archived' AND IsLatestVersion=false AND KnowledgeArticleId='kA01s0000004fMaCAI'
Error :
LastPublishedDate, ArchivedDate,KnowledgeArticleId.Revision_Notes__c
^ ERROR at Row:1:Column:115 Didn't understand relationship 'KnowledgeArticleId' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
Can some one help me to know how to get the knowledge object custom fields using the KnowledgeArticleVersion
object.