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
M K Lal (Mac)M K Lal (Mac) 

Query on Knowledge Article

I'm writing a query as
Query (Sandbox) : select id,knowledgeArticleId from KnowledgeArticleVersion where PublishStatus = 'online' and Language = 'en_US' and knowledgeArticleId
='ANY_ARTICLE_ID'
its running fine on Sandbox, But when we try to run the same query on Production it takeing 'Id' in place of 'KnowledgeArticleVersion' as filter
Query (Production) : select id,knowledgeArticleId from KnowledgeArticleVersion where PublishStatus = 'online' and Language = 'en_US' and Id
='ANY_ARTICLE_ID'

So, for same data fetching I need to create different query as per sandbox/production which is strange... CAN SOMEONE HELP ME ASAP?
Shashikant SharmaShashikant Sharma
Hi,

These are two different queries

Query with this filter knowledgeArticleId = 'ANY_ARTICLE_ID' => will return all versions of a Knwoledge Article

Query with this filter Id = 'ANY_ARTICLE_ID' => will return a particualar versions of a Knwoledge Article

It might be possible that the Knowledge Article that you are using in production has different versions then the one you are using in sandbox. I would recommend to create same number of versions of a Knowledge Article in sandbox and production and test at both orgs. Then you would see the difference.

Let me know if you still have question.

Thanks
Shashikant