You need to sign in to do that
Don't have an account?
Rune Andersen
KnowledgeArticleVersion language paramater as a variable?
I have the following query that works fine, no problems
[SELECT Id FROM KnowledgeArticleVersion WHERE (PublishStatus = 'online' and ArticleNumber=:articleNo and Language = 'en_US')];
It is used to find article id's from articlenumbers.
Now I would like to expand the query to support variable languages so
[SELECT Id FROM KnowledgeArticleVersion WHERE (PublishStatus = 'online' and ArticleNumber=:articleNo and Language = :artLanguage)];
This one is not accepted by the compiler as it violates some restriction to querying the KnowledgeArticleVersion.
Does any one know how to work around this limitation without having to copy and perform a query for each language supported by the Knowledgebase on the current system?
- Regards
[SELECT Id FROM KnowledgeArticleVersion WHERE (PublishStatus = 'online' and ArticleNumber=:articleNo and Language = 'en_US')];
It is used to find article id's from articlenumbers.
Now I would like to expand the query to support variable languages so
[SELECT Id FROM KnowledgeArticleVersion WHERE (PublishStatus = 'online' and ArticleNumber=:articleNo and Language = :artLanguage)];
This one is not accepted by the compiler as it violates some restriction to querying the KnowledgeArticleVersion.
Does any one know how to work around this limitation without having to copy and perform a query for each language supported by the Knowledgebase on the current system?
- Regards
[SELECT Id FROM KnowledgeArticleVersion WHERE (PublishStatus = 'online' and ArticleNumber=:articleNo and Language = : art.MasterLanguage)];
I don't see how this solves my problem. what is the art variable that you're using?
The second select statement with declared variable
String artLanguage = 'en_US';
[SELECT Id FROM KnowledgeArticleVersion WHERE (PublishStatus = 'online' and ArticleNumber=:articleNo and Language = :artLanguage)];
If it is possible I would be happy to leave out the language part of the select statement, but it doesn't seem like Salesforce support this, any good explanations as to why this restrictions apply?