function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

knowledge Article Version ID

Hello everyone,

We have the below functionality on knowledge in our org.

On knowledge objec we have a self lookup to knowledge. We have 2 record types say A(Parent) and B(Child). On B knowledge record type we have a custom field named "Brand Index" to link the record A. If there is linkage between the 2 records the B records are displayed in a list view on A. 

The issue comes when we make the A as "Edit as Draft" and publish new version. The linkage on B still continues to have the old version article ID. We tried to implement the customization to update the " "Brand Index" lookup value on B to new article version but facing some challenges due to salesforce limitations in lightning.
  • Can't able to get both the archived and published versions of artcile in a single soql query. Tried with this query. [ select knowledgearticleid, publishstatus, MigratedToFromArticleVersion from Knowledge__kav where Title = 'Garden Brand Index' and publishstatus in ('archived', 'online') ]. This is returning only the published record. On further investigation we found that we should use IsLatestVersion = false to get the archived articles. But with this we can get only the archived record.
  • Can anyone know if there is any relationship between the published and archived version? If so how to find it?
The requirement in simple words is even if the parent article version is changed, the relationship field on child articles should be auto updated to new version.

Thanks to those who can help me!