• Rune Andersen
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
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
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

I've run across some odd knowledge article behavior.  My KnowledgeAticleVersion soql querys are not working with variable substitution:

 

// Fails with comile error 

String languageCode = 'es';

List<KnowledgeArticleVersion> foo = [select MasterVersionId, Title, Language from KnowledgeArticleVersion where PublishStatus = 'Draft' and Language =: languageCode and IsMasterLanguage = false] ;

 

// Works fine

List<KnowledgeArticleVersion> foo = [select MasterVersionId, Title, Language from KnowledgeArticleVersion where PublishStatus = 'Draft' and Language = 'es' and IsMasterLanguage = false] ;

 

Shouldn't the first example work? 

 

Best,

-james 

This should be a pretty straightforward one but I can't seem to figure out why this isn't working.  I'm trying to create a select box with the different categoryGroups of knowledge.  It seems to work fine when I use basic html <select> and <option>  but when using <apex:selectList> and <apex:selectOption> it does not.

 

This works:

 

<select name="category">
<option Value="myRoot">--All--</option>
<knowledge:categoryList categoryVar="category" categoryGroup="IssueType" rootCategory="myRoot" level="-1">
<option value="{!category.name}">{!category.label}</option>
</knowledge:categoryList>
</select>

 

 

But this does not (only the  --All-- selection is displayed, nothing inside the categoryList loop)

 

<apex:selectList id="issueTypeList" size="1" value="{!issueType}">
<apex:selectOption itemLabel="--All--" itemValue="myRoot" />
<knowledge:categoryList categoryVar="category" categoryGroup="IssueType" rootCategory="myRoot" level="-1">
<apex:selectOption itemLabel="{!category.name}" itemValue="{!category.label}" />
</knowledge:categoryList>
</apex:selectList>

 

 

Is there something about knowledge:categoryList and apex:selectOption that do not play well together?  I'm sure I could work around it using the basic html controls but was hoping to understand why this isn't working.

 

 

Thanks,

 

George

  • April 26, 2010
  • Like
  • 0