CategoryData is an object and DATA CATEGORY is syntax in a SOQL WITH clause. WITH DATA CATEGORY is valid syntax, but WITH CategoryData is not supported.
A SOQL statement using a WITH DATA CATEGORY clause must also include a FROM ObjectTypeName clause where ObjectTypeName equals: • KnowledgeArticleVersion to query all article types • an article type API Name to query a specific article type • Question to query questions When ObjectTypeName equals to KnowledgeArticleVersion or any article type API Name in the FROM clause, a WHERE clause must be specified with one of the following parameters: • PublishStatus to query articles depending on their status in the publishing cycle: - WHERE PublishStatus='online' for published articles - WHERE PublishStatus='archived' for archived articles - WHERE PublishStatus='draft' for draft articles • Id to query an article based on its id
Please refer the below link for detailed example at page 24:
Hello,
For getting ID of the data category please use following query:
SELECT Id FROM CategoryData
Hope this helps!
I tried by the query but seem to be Salesforce doesn't expose the ids for datacategory.
Hello,
CategoryData is an object and DATA CATEGORY is syntax in a SOQL WITH clause. WITH DATA
CATEGORY is valid syntax, but WITH CategoryData is not supported.
A SOQL statement using a WITH DATA CATEGORY clause must also include a FROM ObjectTypeName clause where
ObjectTypeName equals:
• KnowledgeArticleVersion to query all article types
• an article type API Name to query a specific article type
• Question to query questions
When ObjectTypeName equals to KnowledgeArticleVersion or any article type API Name in the FROM clause, a WHERE
clause must be specified with one of the following parameters:
• PublishStatus to query articles depending on their status in the publishing cycle:
- WHERE PublishStatus='online' for published articles
- WHERE PublishStatus='archived' for archived articles
- WHERE PublishStatus='draft' for draft articles
• Id to query an article based on its id
Please refer the below link for detailed example at page 24:
http://www.salesforce.com/us/developer/docs/soql_sosl/salesforce_soql_sosl.pdf
Hope this helps!