You need to sign in to do that
Don't have an account?
Anmol Verma 34
How to get a list of knowledge article linked to some data category in soql apex
I have a requirement where in i need to fetch a list of knowledge articles related to a specific data category. Like my data category name is 'How_to__c' here I need to find the number of Knowledge articles linked to this data category.
Any help will be really appreciated
Any help will be really appreciated
Please use below query. Replace your subcategory name at "Subcategory__c" . This gives the count of articles related to SubCategory under How_to__c. If you have multiple categories under How_to__c and want to query all articles under it use WITH DATA CATEGORY How_to__c AT (Sub1__c,Sub2__c,Sub3__c)
Please refer to the links:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_with_datacategory_examples.htm
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_with_datacategory_catselection.htm
Hope this helps! Please mark as best if it answers.
Thanks
All Answers
Please use below query. Replace your subcategory name at "Subcategory__c" . This gives the count of articles related to SubCategory under How_to__c. If you have multiple categories under How_to__c and want to query all articles under it use WITH DATA CATEGORY How_to__c AT (Sub1__c,Sub2__c,Sub3__c)
Please refer to the links:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_with_datacategory_examples.htm
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_with_datacategory_catselection.htm
Hope this helps! Please mark as best if it answers.
Thanks
Thanks for you reply. Your solution works fine for my use case. Thanks for the solution.
Marking your solution as 'Best Answer'.
Cheers!
Anmol