I wanted to apply filter to the article type, and filtering criteria was that show only articles with data categories. So, I created the following SOQL after reviewing question:
SELECT ID, Title, UrlName, KnowledgeArticleId
FROM Troubleshooting__kav
WHERE Language = 'en_US'
AND Id IN (SELECT ParentId FROM Troubleshooting__DataCategorySelection)
AND publishStatus = 'Online'
ORDER BY Title ASC
The above soql works well if the language is English (en_US
), but if I change the language to Spanish (es_MX
) then it doesn't return any data. I have Spanish translated articles setup in my sandbox. If I remove the following filter
AND Id IN (SELECT ParentId FROM Troubleshooting__DataCategorySelection)
Spanish articles then appear fine.