You need to sign in to do that
Don't have an account?
Tudela
How to build a list of articles with data category information in Site.com?
I have an FAQ article type and an associated data category. I would like to build a public FAQ in Site.com, broken down by category. However, I've been unable to find a way to query the articles with the category information as a filter criteria.
I am able to pull out a list of articles using a Data Repeater on the FAQ__kav object with these filter settings:
Publication Status = online
Visible in Public Knowledge Base = true
Language = en_US
This seems to work fine. But in order to break this down by data category, I need to somehow filter on the categories
Here's an example of what it might look like in SOQL:
SELECT Title FROM FAQ__kav WHERE PublishStatus='Online' AND Language = 'en_US' WITH DATA CATEGORY Geography__c AT (france__c,usa__c).
How can I achieve the same in Site.com?
The data categories don't appear as available filter criteria in the Data Repeater.
I am able to pull out a list of articles using a Data Repeater on the FAQ__kav object with these filter settings:
Publication Status = online
Visible in Public Knowledge Base = true
Language = en_US
This seems to work fine. But in order to break this down by data category, I need to somehow filter on the categories
Here's an example of what it might look like in SOQL:
SELECT Title FROM FAQ__kav WHERE PublishStatus='Online' AND Language = 'en_US' WITH DATA CATEGORY Geography__c AT (france__c,usa__c).
How can I achieve the same in Site.com?
The data categories don't appear as available filter criteria in the Data Repeater.
filteringExpression
If WITH DATA CATEGORY is specified, the query() only returns matching records that are associated with the specified data categories and are visible to the user. If unspecified, the query() returns the matching records that are visible to the user. The WITH DATA CATEGORY clause only filters objects of type:
Question—to query questions.
KnowledgeArticleVersion—to query articles.
For more information about the WITH DATA CATEGORY clause, see WITH DATA CATEGORYfilteringExpression.
http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select.htm
Also See the documentation,
The filteringExpression in the WITH DATA CATEGORY clause uses the following syntax:
dataCategorySelection [AND dataCategorySelection2 ...]
The examples in this section are based on the following data category group:
Geography__c
ww__c
northAmerica__c
usa__c
canada__c
mexico__c
europe__c
france__c
uk__c
asia__c
The category filtering in the statements below is highlighted in bold. The syntax is explained in the following sections.
SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus='online' WITH DATA CATEGORY Geography__c ABOVE usa__c
SELECT Title FROM Question WHERE LastReplyDate > 2005-10-08T01:02:03Z WITH DATA CATEGORY Geography__c AT (usa__c, uk__c)
SELECT UrlName FROM KnowledgeArticleVersion WHERE PublishStatus='draft' WITH DATA CATEGORY Geography__c AT usa__c AND Product__c ABOVE_OR_BELOW mobile_phones__c
You can only use the AND logical operator. The following syntax is incorrect as OR is not supported:
WITH DATA CATEGORY Geography__c ABOVE usa__c OR Product__c AT mobile_phones__c
WITH DATA CATEGORY filteringExpression
http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_with_datacategory.htm#sforce_api_calls_soql_select_with_datacategory
Regards,
Ashish