+ Start a Discussion
Ranjith PunneliRanjith Punneli 

KnowledgeArticleVersion SOQL

When I run below soql query in urlrewriter class, I am getting an error.

 

--KnowledgeArticleVersion[] knowledgeArticle = [SELECT Id, KnowledgeArticleId, Language, Title, Urlname FROM KnowledgeArticleVersion where publishstatus='Online'and Urlname =:articleUrlName and (Language = 'en_US' or Language = 'de') ];

 

--KnowledgeArticleVersion[] knowledgeArticle = [SELECT Id, KnowledgeArticleId, Language, Title, Urlname FROM KnowledgeArticleVersion where publishstatus='Online'and Urlname =:articleUrlName and Language = :userLanguageCode];

 

Error: Compile Error: Implementation restriction: When querying the KnowledgeArticleVersion object, you must filter using the following syntax: Id = [single ID], Id IN [list of ID's] or Language = [language ISO code]. In addition Language is only permitted in a top-level AND condition.

 

How can I get rid of language from where condition or how can I dynamically assign a variable to it?

 

Thanks,

R

Marc_LECONTEMarc_LECONTE

Hello,

 

If you need the Id or a list of Id from Knowledge you have to request them from "KnowledgeArticle" table.

 

Here is more details on it :

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticle.htm#sforce_api_objects_knowledgearticle

 

Hope it help!

Thanks,

Marc LECONTE